aggiunta css x typeahead

This commit is contained in:
Samuele E. Locatelli
2018-07-18 18:22:32 +02:00
parent 5a9afe3edd
commit 10bf242d4f
13 changed files with 420 additions and 8 deletions
+6
View File
@@ -40,6 +40,12 @@ namespace MoonProTablet
bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include(
"~/Scripts/bootstrap.bundle.js"));
/*---------------------------------------
* vedere:
* http://twitter.github.io/typeahead.js/
* http://twitter.github.io/typeahead.js/examples/
* https://msdn.microsoft.com/en-us/magazine/dn913180.aspx?f=255&MSPPError=-2147217396
*/
bundles.Add(new ScriptBundle("~/bundles/typeahead").Include(
"~/Scripts/bloodhound.min.js",
"~/Scripts/typeahead.bundle.min.js",
+1
View File
@@ -4,6 +4,7 @@
<include path="~/Content/bootstrap.min.css" />
<include path="~/Content/font-awesome.min.css" />
<include path="~/Content/fonts.min.css" />
<include path="~/Content/typeahead.min.css" />
<include path="~/Content/dichMan.min.css" />
<include path="~/Content/bloccoMacc.min.css" />
<include path="~/Content/flashing.min.css" />
+141
View File
@@ -0,0 +1,141 @@
/* scaffolding */
/* ----------- */
html {
overflow-y: scroll;
*overflow-x: hidden;
}
.container {
max-width: 750px;
margin: 0 auto;
text-align: center;
}
.tt-menu,
.gist {
text-align: left;
}
/* base styles */
/* ----------- */
html {
font: normal normal normal 18px/1.2 "Helvetica Neue", Roboto, "Segoe UI", Calibri, sans-serif;
color: #292f33;
}
a {
color: #03739c;
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
.table-of-contents li {
display: inline-block;
*display: inline;
zoom: 1;
}
.table-of-contents li a {
font-size: 16px;
color: #999;
}
p + p {
margin: 30px 0 0 0;
}
/* site theme */
/* ---------- */
.title {
margin: 20px 0 0 0;
font-size: 64px;
}
.example {
padding: 30px 0;
}
.example-name {
margin: 20px 0;
font-size: 32px;
}
.demo {
position: relative;
*z-index: 1;
margin: 50px 0;
}
.typeahead,
.tt-query,
.tt-hint {
width: 396px;
height: 30px;
padding: 8px 12px;
font-size: 24px;
line-height: 30px;
border: 2px solid #ccc;
-webkit-border-radius: 8px;
-moz-border-radius: 8px;
border-radius: 8px;
outline: none;
}
.typeahead {
background-color: #fff;
}
.typeahead:focus {
border: 2px solid #0097cf;
}
.tt-query {
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
-moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
}
.tt-hint {
color: #999;
}
.tt-menu {
width: 422px;
margin: 12px 0;
padding: 8px 0;
background-color: #fff;
border: 1px solid #ccc;
border: 1px solid rgba(0, 0, 0, 0.2);
-webkit-border-radius: 8px;
-moz-border-radius: 8px;
border-radius: 8px;
-webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
-moz-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
}
.tt-selectable {
color: #000;
}
.tt-suggestion {
padding: 3px 20px;
font-size: 18px;
line-height: 24px;
}
.tt-suggestion:hover {
cursor: pointer;
color: #fff;
background-color: #0097cf;
}
.tt-suggestion.tt-cursor {
color: #fff;
background-color: #0097cf;
}
.tt-suggestion p {
margin: 0;
}
.gist {
font-size: 14px;
}
/* example specific styles */
/* ----------------------- */
#custom-templates .empty-message {
padding: 5px 10px;
text-align: center;
}
#multiple-datasets .league-name {
margin: 0 20px 5px 20px;
padding: 3px 0;
border-bottom: 1px solid #ccc;
}
#scrollable-dropdown-menu .tt-menu {
max-height: 150px;
overflow-y: auto;
}
#rtl-support .tt-menu {
text-align: right;
}
+176
View File
@@ -0,0 +1,176 @@
/* scaffolding */
/* ----------- */
html {
overflow-y: scroll;
*overflow-x: hidden;
}
.container {
max-width: 750px;
margin: 0 auto;
text-align: center;
}
.tt-menu,
.gist {
text-align: left;
}
/* base styles */
/* ----------- */
html {
font: normal normal normal 18px/1.2 "Helvetica Neue", Roboto, "Segoe UI", Calibri, sans-serif;
color: #292f33;
}
a {
color: #03739c;
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
.table-of-contents li {
display: inline-block;
*display: inline;
zoom: 1;
}
.table-of-contents li a {
font-size: 16px;
color: #999;
}
p + p {
margin: 30px 0 0 0;
}
/* site theme */
/* ---------- */
.title {
margin: 20px 0 0 0;
font-size: 64px;
}
.example {
padding: 30px 0;
}
.example-name {
margin: 20px 0;
font-size: 32px;
}
.demo {
position: relative;
*z-index: 1;
margin: 50px 0;
}
.typeahead,
.tt-query,
.tt-hint {
width: 396px;
height: 30px;
padding: 8px 12px;
font-size: 24px;
line-height: 30px;
border: 2px solid #ccc;
-webkit-border-radius: 8px;
-moz-border-radius: 8px;
border-radius: 8px;
outline: none;
}
.typeahead {
background-color: #fff;
}
.typeahead:focus {
border: 2px solid #0097cf;
}
.tt-query {
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
-moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
}
.tt-hint {
color: #999
}
.tt-menu {
width: 422px;
margin: 12px 0;
padding: 8px 0;
background-color: #fff;
border: 1px solid #ccc;
border: 1px solid rgba(0, 0, 0, 0.2);
-webkit-border-radius: 8px;
-moz-border-radius: 8px;
border-radius: 8px;
-webkit-box-shadow: 0 5px 10px rgba(0,0,0,.2);
-moz-box-shadow: 0 5px 10px rgba(0,0,0,.2);
box-shadow: 0 5px 10px rgba(0,0,0,.2);
}
.tt-selectable {
color: #000;
}
.tt-suggestion
{
padding: 3px 20px;
font-size: 18px;
line-height: 24px;
}
.tt-suggestion:hover {
cursor: pointer;
color: #fff;
background-color: #0097cf;
}
.tt-suggestion.tt-cursor {
color: #fff;
background-color: #0097cf;
}
.tt-suggestion p {
margin: 0;
}
.gist {
font-size: 14px;
}
/* example specific styles */
/* ----------------------- */
#custom-templates .empty-message {
padding: 5px 10px;
text-align: center;
}
#multiple-datasets .league-name {
margin: 0 20px 5px 20px;
padding: 3px 0;
border-bottom: 1px solid #ccc;
}
#scrollable-dropdown-menu .tt-menu {
max-height: 150px;
overflow-y: auto;
}
#rtl-support .tt-menu {
text-align: right;
}
+1
View File
@@ -0,0 +1 @@
html{overflow-y:scroll;*overflow-x:hidden;}.container{max-width:750px;margin:0 auto;text-align:center;}.tt-menu,.gist{text-align:left;}html{font:normal normal normal 18px/1.2 "Helvetica Neue",Roboto,"Segoe UI",Calibri,sans-serif;color:#292f33;}a{color:#03739c;text-decoration:none;}a:hover{text-decoration:underline;}.table-of-contents li{display:inline-block;*display:inline;zoom:1;}.table-of-contents li a{font-size:16px;color:#999;}p+p{margin:30px 0 0 0;}.title{margin:20px 0 0 0;font-size:64px;}.example{padding:30px 0;}.example-name{margin:20px 0;font-size:32px;}.demo{position:relative;*z-index:1;margin:50px 0;}.typeahead,.tt-query,.tt-hint{width:396px;height:30px;padding:8px 12px;font-size:24px;line-height:30px;border:2px solid #ccc;-webkit-border-radius:8px;-moz-border-radius:8px;border-radius:8px;outline:none;}.typeahead{background-color:#fff;}.typeahead:focus{border:2px solid #0097cf;}.tt-query{-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075);}.tt-hint{color:#999;}.tt-menu{width:422px;margin:12px 0;padding:8px 0;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,.2);-webkit-border-radius:8px;-moz-border-radius:8px;border-radius:8px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,.2);-moz-box-shadow:0 5px 10px rgba(0,0,0,.2);box-shadow:0 5px 10px rgba(0,0,0,.2);}.tt-selectable{color:#000;}.tt-suggestion{padding:3px 20px;font-size:18px;line-height:24px;}.tt-suggestion:hover{cursor:pointer;color:#fff;background-color:#0097cf;}.tt-suggestion.tt-cursor{color:#fff;background-color:#0097cf;}.tt-suggestion p{margin:0;}.gist{font-size:14px;}#custom-templates .empty-message{padding:5px 10px;text-align:center;}#multiple-datasets .league-name{margin:0 20px 5px 20px;padding:3px 0;border-bottom:1px solid #ccc;}#scrollable-dropdown-menu .tt-menu{max-height:150px;overflow-y:auto;}#rtl-support .tt-menu{text-align:right;}
+7
View File
@@ -228,6 +228,13 @@
<Content Include="Content\themes\base\tabs.css" />
<Content Include="Content\themes\base\theme.css" />
<Content Include="Content\themes\base\tooltip.css" />
<None Include="Content\typeahead.less" />
<Content Include="Content\typeahead.css">
<DependentUpon>typeahead.less</DependentUpon>
</Content>
<Content Include="Content\typeahead.min.css">
<DependentUpon>typeahead.css</DependentUpon>
</Content>
<Content Include="Controlli.aspx" />
<Content Include="Default.aspx" />
<Content Include="DettaglioMacchina.aspx" />
+13 -3
View File
@@ -14,9 +14,10 @@
Prova typeahead
<div id="bloodhound">
<input class="typeahead" type="text" placeholder="States of USA">
<input id="queryCode" name="queryCode" />
</div>
<script>
var states = ['Alabama', 'Alaska', 'Arizona', 'Arkansas', 'California',
var statesList = ['Alabama', 'Alaska', 'Arizona', 'Arkansas', 'California',
'Colorado', 'Connecticut', 'Delaware', 'Florida', 'Georgia', 'Hawaii',
'Idaho', 'Illinois', 'Indiana', 'Iowa', 'Kansas', 'Kentucky', 'Louisiana',
'Maine', 'Maryland', 'Massachusetts', 'Michigan', 'Minnesota',
@@ -31,7 +32,7 @@
datumTokenizer: Bloodhound.tokenizers.whitespace,
queryTokenizer: Bloodhound.tokenizers.whitespace,
// `states` is an array of state names defined in "The Basics"
local: states
local: statesList
});
$('#bloodhound .typeahead').typeahead({
@@ -42,7 +43,16 @@
{
name: 'states',
source: states
});
}
);
//$('#bloodhound .typeahead').on('typeahead:selected',
// function (e, datum) {
// $("#queryCode").val(datum.name);
// });
</script>
<asp:TextBox ID="hfCustomerId" runat="server" />
</div>
</asp:Content>
+9
View File
@@ -11,5 +11,14 @@ namespace MoonProTablet {
public partial class Test {
/// <summary>
/// Controllo hfCustomerId.
/// </summary>
/// <remarks>
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox hfCustomerId;
}
}
+13 -4
View File
@@ -4,12 +4,21 @@
<div class="row my-2 textCondens font-weight-bold">
<div class="col-6 pr-0">
<div class="text-truncate">
Articolo
Articolo (ricerca + selezione)
</div>
<div class="my-0">
<asp:DropDownList runat="server" ID="ddlArticolo" DataSourceID="odsArticoli" DataTextField="label" DataValueField="value" CssClass="form-control"></asp:DropDownList>
<asp:ObjectDataSource ID="odsArticoli" runat="server" OldValuesParameterFormatString="original_{0}"
SelectMethod="GetData" TypeName="MapoDb.DS_UtilityTableAdapters.v_selArticoliTableAdapter"></asp:ObjectDataSource>
<div class="input-group mb-3">
<div class="input-group-prepend">
<asp:TextBox runat="server" ID="txtSearch" CssClass="form form-control" AutoPostBack="True" OnTextChanged="txtSearch_TextChanged" place="Ricerca" Width="5em" />
</div>
<asp:DropDownList runat="server" ID="ddlArticolo" DataSourceID="odsArticoli" DataTextField="label" DataValueField="value" CssClass="form-control"></asp:DropDownList>
<asp:ObjectDataSource ID="odsArticoli" runat="server" OldValuesParameterFormatString="original_{0}"
SelectMethod="getByConditio" TypeName="MapoDb.DS_UtilityTableAdapters.v_selArticoliTableAdapter">
<SelectParameters>
<asp:ControlParameter ControlID="txtSearch" DefaultValue="Non definito" Name="conditio" PropertyName="Text" Type="String" />
</SelectParameters>
</asp:ObjectDataSource>
</div>
</div>
</div>
<div class="col-2 pr-0 pl-1">
+33 -1
View File
@@ -9,14 +9,46 @@ namespace MoonProTablet.WebUserControls
{
public partial class cmp_newODL : System.Web.UI.UserControl
{
/// <summary>
/// registrato nuovo valore
/// </summary>
public event EventHandler eh_newVal;
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
setDefaults();
}
}
/// <summary>
/// imposta valori std
/// </summary>
private void setDefaults()
{
txtNumPz.Text = "1";
txtTC_min.Text = "1";
txtTC_sec.Text = "0";
}
protected void lbtCreaOdlProvv_Click(object sender, EventArgs e)
{
// effettua creazione ODL provvisorio e riporta a parent...
// invio email notifica creazione ODL PROVVISORIO (da riconciliare...)
// sollevo evento!
if (eh_newVal != null)
{
eh_newVal(this, new EventArgs());
}
}
protected void txtSearch_TextChanged(object sender, EventArgs e)
{
ddlArticolo.DataBind();
}
}
}
+9
View File
@@ -21,6 +21,15 @@ namespace MoonProTablet.WebUserControls {
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlGenericControl divDetail;
/// <summary>
/// Controllo txtSearch.
/// </summary>
/// <remarks>
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtSearch;
/// <summary>
/// Controllo ddlArticolo.
/// </summary>
+7
View File
@@ -110,6 +110,13 @@ namespace MoonProTablet.WebUserControls
{
checkAll();
}
cmp_newODL.eh_newVal += Cmp_newODL_eh_newVal;
}
private void Cmp_newODL_eh_newVal(object sender, EventArgs e)
{
// creato nuovo ODL, faccio refresh ricaricando pagina!
Response.Redirect("~/ODL");
}
public void checkAll()
+4
View File
@@ -30,5 +30,9 @@
{
"outputFile": "Content/flashing.css",
"inputFile": "Content/flashing.less"
},
{
"outputFile": "Content/typeahead.css",
"inputFile": "Content/typeahead.less"
}
]