View Single Post
Old 11-01-2012, 02:07 PM   PM User | #1
branko7171
New to the CF scene

 
Join Date: Oct 2012
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
branko7171 is an unknown quantity at this point
Grids load data only once?

Hey,
on my page I have 2 jqxTrees and 2 jqxListboxes. What I'm trying to do is show properties of the selected element from those widgets. I do that using jqxGrid which loads data from the database on select event.
It works fine the first time I select a listBox element (or tree). However, when I select another element from that widget nothing is shown.
I have determined that no data is sent to the php file (no GET variable is sent).
Of course, selecting for the first time sends the variable.
Here's the code that fires on select event from one of 2 trees (the code for the 3 remaining widgets is similiar):

Code:
$('#problemiTree').bind('select', function (event) {
                    dataAdapter4.dataBind();                    
                    var item3 = $('#problemiTree').jqxTree('getSelectedItem');                      
   
                    var sourceGridOblast ={
                        datatype: "json",
                        async:false,
                        datafields: 
                            [{ name: 'Naziv' },
                            { name: 'NadOblast' },
                            { name: 'Opis' }],
                        url: 'gridData.php',
                        processdata: function (data) {
                            data.selItemObl = item3.id;
                            /*if (data.selItemObl) data.selItemObl = data.selItemObl.id;
                            else data.selItemObl.id = 0; */
                        }
                    };
                
                    var dataAdapterSourceGridOblast = new $.jqx.dataAdapter(sourceGridOblast);
                    var jqxgridOblastOptions ={
                        source: dataAdapterSourceGridOblast,
                        theme: 'classic',
                        columns: 
                            [{ text: 'Naziv',datafield: 'Naziv', width: 150 },
                            { text: 'Nadoblast', datafield: 'NadOblast', width: 150  },
                            { text: 'Opis', datafield: 'Opis', width: 400 }]
                    };
                    $('#svojstvaPanel').jqxPanel('clearcontent');
                    $('#svojstvaPanel').jqxPanel('append', $("#grid3")[0]);
                    $("#grid3").jqxGrid(jqxgridOblastOptions);
                    
                });
Hope you can help me. Thanks.

Last edited by branko7171; 11-01-2012 at 02:10 PM..
branko7171 is offline   Reply With Quote