It seems my original issue with placing more than one dropdown grid on a page is in part due to the fact that I may not be binding the dropdown to SQL properly. Is this how it should be done? I’m getting this error in Firebug “row is null” on var dropDownContent. I understand that it is null because I’m not using generatedata as my source. I’m instead calling the info from SQL. Just not sure what to put instead of row.
$(document).ready(function () {
var theme = getTheme();
var createGrid = function (gridid, dropdownid) {
var source =
{
datatype: “json”,
datafields: [{ name: ‘Description’ }, ],
url: ‘Map/GetRegion’,
updaterow: function (rowid, rowdata) {
// synchronize with the server – send update command
}
};
// initialize jqxGrid
$(dropdownid).jqxDropDownButton({ width: 150, height: 25, theme: theme });
$(gridid).jqxGrid(
{
width: 550,
source: source,
theme: theme,
pageable: true,
autoheight: true,
columns: [
{ text: ‘Description’, columntype: ‘textbox’, datafield: ‘Description’, width: 90 },
]
});
$(gridid).bind(‘rowselect’, function (event) {
var args = event.args;
var row = $(gridid).jqxGrid(‘getrowdata’, args.rowindex);
var dropDownContent = ‘
‘ + row[‘Description’] + ‘
‘;
$(dropdownid).jqxDropDownButton(‘setContent’, dropDownContent);
});
$(gridid).jqxGrid(‘selectrow’, 0);
}
createGrid(“#jqxgrid”, “#jqxdropdownbutton”);
});