Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var dropdownlist = $("#ddlLocation").data("kendoDropDownList");
- dropdownlist.select(function (dataItem) {
- return dataItem.symbol === "[Please Select Location]";
- });
- var userId = $("#hiddenUser").val();
- $("#PositionInputs").kendoDropDownList({
- dataTextField: "Name",
- dataValueField: "ID",
- index: 0,
- autoBind: false,
- change: function () {
- var value = this.value();
- var dataItem1 = this.dataItem(this.select());
- if (value) {
- var dropdownlist = $("#ddlLocation").data("kendoDropDownList");
- dropdownlist.select(function (dataItem) {
- return dataItem.symbol === "[Please Select Location]";
- });
- }
- },
- optionLabel: "[Please Select Position]",
- template: '<h5>${ data.Name }</h5>',
- dataSource: {
- transport: {
- read: {
- url: '/Profile/LoadDropdownList?userId=' + userId,
- dataType: "json",
- type: "POST"
- }
- }
- }
- });
- //kendo dropdown
- $("#ddlPosition").kendoDropDownList({
- dataTextField: "Name",
- dataValueField: "ID",
- autoBind: false,
- optionLabel: {
- Name: "[Please Select Position]",
- ID: "0"
- },
- // define custom template
- template:
- '<h5>${ data.Name }</h5>',
- dataSource: {
- transport: {
- read: {
- url: '/Profile/LoadDropdownList?userId=' + userId,
- dataType: "json",
- type: "POST"
- }
- }
- }
- });
- //kendo dropdown
- $("#ddlLocation").kendoDropDownList({
- dataTextField: "Address",
- dataValueField: "Id",
- autoBind: false,
- optionLabel: "[Please Select Position]",
- // define custom template
- template: '<h5>${ data.Address }</h5>',
- dataSource: {
- transport: {
- read: {
- url: '/Profile/LoadLocationDropdownList?userId=' + userId,
- dataType: "json",
- type: "POST"
- }
- }
- }
- });
- $("#LocationInputs").kendoDropDownList({
- dataTextField: "Address",
- dataValueField: "Id",
- // index: 0,
- autoBind: false,
- cascadeFrom: "PositionInputs",
- optionLabel: {
- Address: "[Please Select Position]",
- Id: "0"
- },
- template: '<h5>${ data.Address }</h5>',
- dataSource: {
- transport: {
- read: {
- url: '/Profile/LoadLocationDropdownList?userId=' + userId,
- dataType: "json",
- type: "POST"
- }
- }
- }
- });
- var ddl = $("#someId").data("kendoDropDownList");
- ddl.select(0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement