or
Mozilla/5.0 (Linux; U; Android 4.0.3; en-us; Transformer TF101 Build/IML74K) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Safari/534.30
Mozilla/5.0 (Linux; Android 4.0.3; Transformer TF101 Build/IML74K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.94 Safari/537.36
<
ul
data-role
=
"listview"
data-type
=
"group"
id
=
"itemListView"
data-click
=
"listViewClick"
data-style
=
"inset"
>
<
li
class
=
"km-group-container words"
>
<
div
class
=
"km-group-title"
>
<
div
class
=
"km-text"
>test</
div
>
</
div
>
<
ul
class
=
"km-list"
>
<
li
class
=
"checkboxlimit"
cbl
=
"2"
ontouchend
=
"touchEnd(event);"
><
label
class
=
"km-listview-label"
><
input
type
=
"checkbox"
id
=
"item1"
>A1</
label
></
li
>
<
li
class
=
"checkboxlimit"
cbl
=
"2"
ontouchend
=
"touchEnd(event);"
><
label
class
=
"km-listview-label"
><
input
type
=
"checkbox"
id
=
"item2"
>A2</
label
></
li
>
<
li
class
=
"checkboxlimit"
cbl
=
"2"
ontouchend
=
"touchEnd(event);"
><
label
class
=
"km-listview-label"
><
input
type
=
"checkbox"
id
=
"item3"
>A3</
label
></
li
>
<
li
class
=
"checkboxlimit"
cbl
=
"2"
ontouchend
=
"touchEnd(event);"
><
label
class
=
"km-listview-label"
><
input
type
=
"checkbox"
id
=
"item4"
>A4</
label
></
li
>
</
ul
>
</
li
>
</
ul
>
function
listViewClick(e){
if
(e.target.hasClass(
"boxlimit"
)){
//setTimeout(function(){
var
target=e.target.find(
"input[type=checkbox]"
);
MYAPP.MultiObj=target;
var
fathernode=e.target.parent();
var
root=fathernode.parent();
var
max=parseInt(fathernode.attr(
"cbl"
));
if
(max==
""
|| max<=0)
return
;
var
total=0;
var
obj=root.find(
"input[type=checkbox]"
);
for
(
var
i=0; i<obj.length;i++){
//console.log("index:"+i+obj.eq(i).attr("checked"));
//console.log("index:"+i+obj.eq(i).prop("checked"));
if
(obj.eq(i).prop(
"checked"
)){
total=total+1;
if
(total>max){
//obj.eq(i).removeAttr("checked");
MYAPP.MultiObj.removeAttr(
"checked"
);
openSubmitDailog(
" exceed max number what can be choosed!"
);
//console.log("no more than...");
return
false
;
}
}
}
//},300);
}
}
public class CategoryViewModel
{
public int? CategoryId { get; set; }
public string CategoryName { get; set; }
}
@model ViewModel.Query.CategoryViewModel
@(
Html.Kendo().DropDownListFor(m => m)
.DataTextField("CategoryName")
.DataValueField("CategoryId")
.BindTo((System.Collections.IEnumerable)ViewData["categories"])
)
@(Html.Kendo().Grid<
TestCategoryQueryModel
>()
.Name("Grid")
.Columns(columns =>
{
columns.Bound(p => p.Id);
columns.Bound(p => p.CatName);
columns.Bound(p => p.CatDescription).Filterable(false);
columns.Bound(p => p.CatImg).Filterable(false);
columns.Bound(p => p.Categories).Filterable(false);
columns.Bound(p => p.CatPublish).Filterable(false);
columns.Bound(p => p.CatShowOrder).Filterable(false);
columns.Bound(p => p.CatSubjectToAcl).Filterable(false);
columns.Bound(p => p.CatSearchKeys).Filterable(false);
columns.Command(c =>
{
c.Edit();
c.Destroy();
});
})
.ToolBar(tools =>
{
tools.Create();
})
.Sortable()
.Editable(editable => editable.Mode(GridEditMode.InLine))
.Pageable(pageable =>
{
pageable.Refresh(true);
pageable.PageSizes(true);
})
.Filterable()
.Groupable()
.ColumnMenu()
.DataSource(dataSource => dataSource
.Ajax()
.Model(model =>
{
model.Id(p => p.Id);
model.Field(p => p.Categories).DefaultValue(ViewData["defaultCategory"] as CategoryViewModel);
})
.Events(events=>events.Error("error_handler"))
.Read(read => read.Url("/api/TestCategoryWebApi").Type(HttpVerbs.Get))
.Create(create => create.Url("/api/TestCategoryWebApi").Type(HttpVerbs.Post))
.Update(update => update.Url("/api/TestCategoryWebApi").Type(HttpVerbs.Put))
.Destroy(destroy => destroy.Url("/api/TestCategoryWebApi").Type(HttpVerbs.Delete))
))
({$id:
"2"
, Id:1, CatName:
"Category Name1"
, CatDescription:
"Test Description1"
, CatImg:
"Image1"
, CatParentId:1, CatSubjectToAcl:
false
, CatSearchKeys:
"Test 1"
, CatPublish:
true
, CatShowOrder:1, Categories:{CategoryId:3, CategoryName:
"Category Name11"
}})
var scheduler = $("#scheduler").data("kendoScheduler");
scheduler.destroy();
<
div
id
=
"view1"
data-role
=
"view"
data-model
=
"viewModel"
data-title
=
"view1"
>
<
ul
id
=
"listview"
data-bind
=
"source: dataSource, click: foo"
data-role
=
"listview"
data-template
=
"template"
></
ul
>
</
div
>
<
script
type
=
"text/x-kendo-template"
id
=
"template"
>
<
a
>${link}</
a
>
</
script
>
var
viewModel = kendo.observable ({
foo:
function
(parameter) {
//use parameter
}
});