jQWidgets Forums
jQuery UI Widgets › Forums › Grid › Dropdownlist column in grid
Tagged: DropDownList, grid, jqxDropDownList, jqxgrid, valueMember
This topic contains 5 replies, has 2 voices, and was last updated by Dimitar 12 years, 7 months ago.
-
Author
-
Hi,
In my grid have two columns have dropdownlists binded same list to dropdownlist.while reading i was not getting second dropdownlist column value and While reading what every i changes in dropdown values i was not getting .Following code written for dropdownlists.
var Adminusersource = { datatype: "json", datafields: [ { name: 'PrimaryUserID' }, { name: 'AdminUsernames' } ], id: 'id', url: '../DataAdminOwnership/GetAdminUsers/' }; var AdmindUserataAdapter = new $.jqx.dataAdapter(Adminusersource); $("#").jqxGrid( { width: 886, height: 220, editable: true, source: PlatformdataAdapter, theme: theme, altrows: true, filterable: true, selectionmode: 'singlecell', pageable: true, sortable: true, pageable: true, enabletooltips: true, columns: [ { text: 'Platform ', dataField: 'Platform', editable: false, width: 295 }, { text: 'PrimaryOwner', dataField: 'PrimaryUserName', columntype: 'dropdownlist', width: 296, createeditor: function (row, cellvalue, editor) { editor.jqxDropDownList({ displayMember: 'AdminUsernames', valueMember: 'AdminUserIDs',source: AdmindUserataAdapter }); editor.bind('select', function (event) { var selectedIndex = event.args.index; }); } }, // { text: 'PrimaryUserID', dataField: 'PrimaryUserID', columntype: 'dropdownlist' }, { text: 'BackUpOwner', dataField: 'BackupOwnersName', columntype: 'dropdownlist', width: 300, createeditor: function (row, cellvalue, editor) { editor.jqxDropDownList({ displayMember: 'AdminUsernames',valueMember: 'AdminUserIDs', source: AdmindUserataAdapter}); editor.bind('select', function (event) { var selectedIndex = event.args.index; }); } } //{ text: 'BackupOwnersID', dataField: 'BackupOwnersID', columntype: 'dropdownlist' } ] }) Thanks Sree
Hello Sree,
The valuemember of your dropdownlist column (in this case, columns) – ‘AdminUserIDs’ is not present in your source. This may be the cause for your issue.
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/Hi Dimitar,
I change what ever you suggested but still have same problem, I am not read values from dropdownlists,Can you suggest me .
Thanks
SreeHi Sree,
Did you add the ‘AdminUserIDs’ datafield? Does your source file have three datafields? Please provide this additional feedback.
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/Hi Dimitar,
I Changed ‘AdminUserIDs’ ‘ datafield. Still i have same problem , Here i find problem , Dropdownlist iteam selected through mouse after selection that iteam is not binding to row ,when i press enter key in keyboard than that item is binding row than i reading that value.is there any mouse evet for bind row after selection iteam . Please can suggest me.
Thanks
SreeniHi Sreeni,
It is not possible to save the cell on item selection. You have to click outside the cell or press the enter key to do that.
As for the previous issue, please provide us with your updated source code so we can better be of help.
To see how to format HTML code properly in this forum, please check out the topic Code Formatting.
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/ -
AuthorPosts
You must be logged in to reply to this topic.