or
{% extends "saloons/templates/base.html" %}
{% from "ui/forms/macro.html" import wtform %}
{% block content %}
<
form
method
=
"POST"
action
=
""
>
<
table
>
<
tr
>
<
td
>{{ form.order_date.label }}</
td
>
<
td
>{{ form.order_date }}</
td
>
</
tr
>
</
table
>
<
div
id
=
"grid-users"
class
=
"grid-content"
style
=
"text-align: center; width: 100%!important"
>
<
table
id
=
"grid"
>
<
thead
>
<
tr
>
<
th
data-field
=
"number"
style
=
"text-align: center"
>Nro.</
th
>
<
th
data-field
=
"item"
style
=
"text-align: center"
>Articulo</
th
>
<
th
data-field
=
"staff"
style
=
"text-align: center"
>Usuario</
th
>
<
th
data-field
=
"button"
style
=
"text-align: center"
>AƱadir/Remover</
th
>
</
tr
>
</
thead
>
<
tbody
id
=
"pedidos"
>
<
tr
>
<
td
>1.</
td
>
<
td
>{{ form.item }}</
td
>
<
td
>{{ form.staff }}</
td
>
<
td
><
button
type
=
"button"
id
=
"add_textbox"
>+</
button
></
td
>
</
tr
>
</
tbody
>
</
table
>
<
center
>
<
div
class
=
"buttons"
>{{ form.save }}</
div
>
</
center
>
</
div
>
</
form
>
<
script
type
=
"text/javascript"
>
$(function() {
$("#save").attr('class','k-button');
$("#c0").attr('class', 'k-input');
var sel = $("#t0").clone();
var sel2 = $("#c0").clone();
var i = 1;
var data = "{{ inventory }}".replace("[", "").replace("]", "");
var a = data.split(",");
for(j=0;j<
a.length
;j++)
{
if(j == 0){
a[j] = a[j].substring(2,a[j].length -1);
}
else
{
a[j] = a[j].substring(3,a[j].length -1);
}
}
$("#add_textbox").attr('class', 'k-button');
$("#add_textbox").live('click', function() {
i++;
$("#pedidos").append('<tr>' +
'<
td
>'+ i +'. </
td
>' +
'<
td
id
=
"c'+ i +'"
></
td
>' +
'<
td
id
=
"t'+ i +'"
></
td
>' +
'<
td
><
button
type
=
"button"
rel
=
"del"
class
=
"k-button"
>-</
button
></
td
>' +
'</
tr
>');
$(sel2).attr('id',"tc"+i);
$(sel).attr('id',"ts"+i);
$(sel2).appendTo("#c"+i);
$(sel).appendTo("#t"+i);
$("#tc"+i).css('width', 180);
$("#tc"+i).kendoAutoComplete({
dataSource: a
});
sel = $(sel).clone();
sel2 = $(sel2).clone();
$("#ts"+i).css('width', 270);
$("#ts"+i).kendoDropDownList();
});
$("button[rel=del]").live('click', function() {
$(this).parent().parent().remove();
i--;
var a2 = 0;
$("#pedidos tr").each(function(i){
a2++;
$(this).find("td:first").html(a2);
});
});
$("#order_date").kendoDatePicker({
min: new Date(),
value: new Date(),
format: "dd/MM/yyyy"
});
$("#order_date").attr('disabled','disabled');
$("#grid").kendoGrid({
height: 460,
sortable: false,
columns: [{field:"number", width:40},
{field:"item", width:40},
{field:"staff", width:80, editor: function(container, options){
}},
{field:"button", width:40}]
});
$("#t0").css('width', 270);
$("#t0").kendoDropDownList();
$("#c0").css('width', 180);
$("#c0").kendoAutoComplete({
dataSource: a
});
});
</
script
>
{% endblock %}
$(
'#'
+ idGrid).kendoGrid({
dataSource: dataSource,
height: 400,
toolbar: [{name:
"create"
, text:
"Create County"
}],
columns: [
{ field:
"_id"
, title:
"ID"
, width:
"50px"
},
{ field:
"_status"
, values: status, title:
"Status"
, width:
"100px"
, editor: status_dropdown },
{ field:
"_country_id"
, title:
"Country"
, values: countries, width:
"50px"
, editor: country_dropdown },
{ field:
"_county_id"
, title:
"County"
, values: counties, width:
"50px"
, editor: county_dropdown },
{ field:
"code"
, title:
"Code"
, width:
"150px"
},
{ field:
"name"
, title:
"Name"
, width:
"150px"
},
{ field:
"localname"
, title:
"Localname"
, width:
"150px"
},
{ command: [
"edit"
,
"destroy"
], title:
" "
, width:
"200px"
}],
editable:
"popup"
,
sortable: {
mode:
"multiple"
,
allowUnsort:
true
},
filterable:
true
,
resizable:
true
,
groupable:
true
,
pageable: {
pageSize: 30,
refresh:
true
}
});
var
status = [{
"value"
: 0,
"text"
:
"Disabled"
}, {
"value"
: 1,
"text"
:
"Enabled"
}];
var
countiesData;
var
counties =
new
Array();
var
countiesDataSource =
new
kendo.data.DataSource({
transport: {
read: {
url:
"../order_new/county.php"
}
},
schema: {
data:
"data"
},
change:
function
(e) {
countiesData =
this
.data();
console.log(countiesData);
var
counties =
new
Array();
for
(
var
i = 0; i < countiesData.length; i++) {
var
dataItem = countiesData[i];
counties.push({
"value"
: parseInt(dataItem._id),
"text"
: dataItem.name
});
}
//here goes the previous code of grid creation
}
@model Model.Test
@(Html.Kendo().PanelBar()
.Name(
"panelbar"
)
.ExpandMode(PanelBarExpandMode.Single)
.HtmlAttributes(
new
{ style =
"width:300px"
})
.Items(panelbar =>
{
panelbar.Add().Text(
"My Teammates"
)
.Expanded(
true
)
.Content(@<div style=
"padding: 10px;"
>
<div class=
"teamMate"
>
<h2>Andrew Fuller</h2>
<p>Team Lead</p>
</div>
<div class=
"teamMate"
>
<h2>Nancy Leverling</h2>
<p>Sales Associate</p>
</div>
<div class=
"teamMate"
>
<h2>Robert King</h2>
<p>Business System Analyst</p>
</div>
</div>);
panelbar.Add().Text(
"Projects"
)
.Items(projects =>
{
projects.Add().Text(
"New Business Plan"
);
projects.Add().Text(
"Sales Forecasts"
)
.Items(forecasts =>
{
forecasts.Add().Text(
"Q1 Forecast"
);
forecasts.Add().Text(
"Q2 Forecast"
);
forecasts.Add().Text(
"Q3 Forecast"
);
forecasts.Add().Text(
"Q4 Forecast"
);
});
projects.Add().Text(
"Sales Reports"
);
});
panelbar.Add().Text(
"Programs"
)
.Items(programs =>
{
programs.Add().Text(
"Monday"
);
programs.Add().Text(
"Tuesday"
);
programs.Add().Text(
"Wednesday"
);
programs.Add().Text(
"Thursday"
);
programs.Add().Text(
"Friday"
);
});
panelbar.Add().Text(
"Communication"
).Enabled(
false
);
})
)