Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Oct 2012
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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.

  • #2
    New to the CF scene
    Join Date
    Oct 2012
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Solved it. You can close this topic.


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •