or
command: { text: "View Details", click: showDetails }, title: " ", width: "140px"
<
a
class
=
"k-button k-button-icontext k-grid-View Details"
href
=
"#"
>
<
span
class
=
" "
></
span
>
View Details
</
a
>
<
a
class
=
"k-button k-button-icontext k-grid-ViewDetails"
href
=
"#"
>
<
span
class
=
" "
></
span
>
View Details
</
a
>
save:
function
(e) {
if
(e.values[
"FA_No_"
]) {
//Select below loops thru all values in ddl and if it = FANo,
//then set the other fields based off the FA.
//If we set the FANo field somewhere above, it does NOT trigger the
//dd.select() or .change(), so we create inline select() below to
//set the fields we need.
//NOTE: 'e.model' refers to datasource model fields and the
//faddl.dataItem refers to the ddl datasource fields.
var
currFA = e.values[
"FA_No_"
];
var
faddl = $(
"#ddFA"
).data(
"kendoDropDownList"
);
faddl.select(
function
(dataItem) {
if
(dataItem.Code == currFA) {
//First reset all values based on FANo.
e.model.set(
"Description"
,
""
);
e.model.set(
"Serial_No_"
,
""
);
//Next, update all values based on newly selected FANo.
if
(dataItem.SerialNo)
e.model.set(
"Serial_No_"
, dataItem.SerialNo);
return
dataItem.text === currFA;
}
});
}
}
<ul id="k-menu2"></ul> <script type="text/javascript"> $(document).ready(function() { $("#k-menu2").kendoMenu( { dataTextField: "Name", dataValueField: "Id", dataSource: { type: "json", transport: { read: "http://jason.platform4telecom.com/JsonTest/GetRoles/henkjelt/simpel/1/58/1" } } }); });"
<
div
id
=
"dlsAdmin"
>
<
select
id
=
"Mode"
name
=
"Mode"
data-bind
=
"events: { change: ChangeMode }"
>
<
option
value
=
"Maintenance"
>Maintenance</
option
>
<
option
value
=
"Reporting"
>Reporting</
option
>
</
select
>
<
div
id
=
"customerTree"
data-role
=
"treeview"
data-bind
=
"source: TreeViewDataSource, value: SelectedNode"
data-checkboxes
=
"{ checkChildren: true }"
data-load-on-demand
=
"false"
data-text-field
=
"text"
data-value-field
=
"id"
>
</
div
>
</
div
>
// Generated by CoffeeScript 1.3.3
(
function
() {
var
root;
root =
typeof
window !==
"undefined"
&& window !==
null
? window : global;
root.DLSAdminManager = (
function
() {
function
DLSAdminManager(treeViewUrl) {
var
dataSource;
this
.SelectedNode = {};
dataSource = {
transport: {
read: {
url: treeViewUrl,
dataType:
'json'
}
},
schema: {
model: {
id:
'id'
,
hasChildren:
'hasChildren'
}
}
};
this
.TreeViewDataSource =
new
kendo.data.HierarchicalDataSource(dataSource);
}
DLSAdminManager.prototype.ChangeMode =
function
() {
return
alert(
'change mode!'
);
};
return
DLSAdminManager;
})();
}).call(
this
);
$(
function
() {
var
adminManager = kendo.observable(
new
DLSAdminManager(
'/Admin/GetAccountHierarchy'
));
kendo.bind(
'#dlsAdmin'
, adminManager);
});