CodingForums.com

CodingForums.com (http://www.codingforums.com/index.php)
-   JavaScript frameworks (http://www.codingforums.com/forumdisplay.php?f=62)
-   -   jQuery Grids load data only once? (http://www.codingforums.com/showthread.php?t=280317)

branko7171 11-01-2012 02:07 PM

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.

branko7171 11-02-2012 02:30 PM

Solved it. You can close this topic.


All times are GMT +1. The time now is 10:45 AM.

Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.