jQWidgets Forums
Forum Replies Created
-
Author
-
Thanks for your reply. I guess I wasn’t clear enough in the post. I put unique IDs in my divs and called them with matching jquery functions and still had issues. The code I posted was for only one of the divs. I’m going to look at this again and see if I’ve missed something. Thanks for your help!
Unfortunately I have tried everything to get this working and I can only show one dropdown grid at a time. Please look at my code and tell me what I am doing wrong. I’m trying out jqwidgets for a very large project and we will be purchasing a license. If I can’t get this figured out, I’m going to have to look at other plugins.
$(document).ready(function () {
// prepare the data
theme = ‘classic’
var source = {
datatype: “json”,
datafields: [{ name: ‘Code’ }, { name: ‘Description’ }, ],
url: ‘View/GetCodes’
};
var dataAdapter = new $.jqx.dataAdapter(source);
// initialize jqxGrid
$(“#jqxdropdownbutton”).jqxDropDownButton({ width: 150, height: 25, theme: theme });
$(“#jqxgrid”).jqxGrid(
{
width: 550,
source: dataAdapter,
theme: theme,
pageable: true,
autoheight: true,
columns: [
{ text: ‘Code’, columntype: ‘textbox’, datafield: ‘Code’, width: 90 },
{ text: ‘Description’, datafield: ‘Description’, columntype: ‘textbox’, width: 90 },]
});
$(“#jqxgrid”).bind(‘rowselect’, function (event) {
var args = event.args;
var row = $(“#jqxgrid”).jqxGrid(‘getrowdata’, args.rowindex);
var dropDownContent = ‘‘ + row[‘Code’] + ‘ ‘ + row[‘Description’] + ‘‘;
$(“#jqxdropdownbutton”).jqxDropDownButton(‘setContent’, dropDownContent);
});
$(“#jqxgrid”).jqxGrid(‘selectrow’, 0);
});Shouldn’t I just be able to copy and paste the script code and change to jqxdropdownbutton2 and jqxgrid2 and add some matching divs for this to work? What am I doing wrong?
Thanks for your fast reply. I tried your exact code and it works, but it sends back three dropdowns with the same data.My 3 dropdowns are tied to different database tables and not the same array. How would I implement that?
Thanks for the reply but it doesn’t work.
-
AuthorPosts