Go Back   CodingForums.com > :: Client side development > JavaScript programming > JavaScript frameworks

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
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
Old 11-02-2012, 02:30 PM   PM User | #2
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
Solved it. You can close this topic.
branko7171 is offline   Reply With Quote
Reply

Bookmarks

Tags
jqwidgets

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:29 PM.


Advertisement
Log in to turn off these ads.