Hello Tony:

I think I got this functionality working.
http://pssnet.com/~devone/ajqtable/summary392.html
I thought I needed Ajax function to get this working.  But, it seems I
don't need that.  datatype: function(postdata)...I don't need this
stuff.

Thank you again for this help, and for a really good plugin.


Regards,
Nat


<script type="text/javascript">


jQuery(document).ready(function(){

jQuery("#list2").jqGrid({

    url:'summary3.php?nd='+new Date().getTime(),

    datatype: "json",

    colNames:['Id', 'Services'],

    colModel:[

        {name:'service_id',index:'service_id', width:75},

        {name:'name',index:'name', width:175},

                ],

    pager: jQuery('#pager2'),

    rowNum:10,

    rowList:[10,20,30],

    imgpath: 'themes/sand/images',

    sortname: 'id',

    viewrecords: true,

    sortorder: "asc",



        ondblClickRow: function(id){
                var x = id;
                        alert("You double click row with id: "+id);
                        jQuery("#list3").setGridParam({url:'get_services.php?
name='+x}).trigger
("reloadGrid")
                  //jQuery("#list3").trigger("reloadGrid");
                },  //end ondblClickRow function

   caption: "Services"


});


         jQuery("#list3").jqGrid({


    datatype: "json",

                        colNames:['Product No', 'Name', 'type'],

                        colModel:[

                                {name:'product_id',index:'product_id', 
width:75},

                                {name:'name',index:'name', width:100},

                                {name:'type',index:'type', width:100},

                                ],

                        pager: jQuery('#pager3'),

                        rowNum:10,

                        rowList:[10,20,30],

                        imgpath: 'themes/sand/images',

                        sortname: 'id',

                        viewrecords: true,

                        sortorder: "asc"
                        });



});

</script>

On Apr 8, 10:08 am, Tony <t...@trirand.com> wrote:
> Hello,
> Maybe you do not understand me.
> The definition
> jQuery("#list3").jqGrid({ ..})
>
> should be outside of ondblClickRow.
> That is:
>
> jQuery(document).ready(function(){
> //begin list2 grid
> var x;
> jQuery("#list2").jqGrid({
> ...
>  ondblClickRow: function(id){
>    var x = id;
>     alert("You double click row with id: "+id);
>     jQuery("#list3").trigger("reloadGrid");},
> ...
> });
>
> // end of list2 grid
>
> // begin list3 grid
> jQuery("#list3").jqGrid({...})
> // end list3 grid
>
> }); // end document ready
>
> Hope this help.
>
> On Apr 8, 4:07 pm, "NatkeeranL.K." <natkee...@gmail.com> wrote:
>
> > Hello Tony:
>
> > Thank you for the reply.
>
> > I inserted like below.  But, it does not load the 
> > data:http://pssnet.com/~devone/ajqtable/summary36.html.  Just empty grid.
>
> > I also tried to inserted like jQuery(#list3).trigger
> > ("reloadGrid").jqGrid({....no success.
>
> > I just need the functionality, thus any sample code that works...I'll
> > adopt.
>
> > Thanks again for the time.
>
> > Regards,
> > Nat
>
> > ondblClickRow: function(id){
> >                 var x = id;
> >                 alert("You double click row with id: "+id);
> >                 jQuery("#list3").trigger("reloadGrid");
> >                         // Load Dynamic Data
> >                 jQuery("#list3").jqGrid({
>
> >                                 datatype: function(postdata){
> >                                         jQuery.ajax({
> >                                         url:'get_services.php?name='+x,
> >                                         data:postdata,
>
> >                                         datatype: "json",
> >                                         type: 'POST',
> >                                         contentType: "application/json; 
> > charset=utf-8",
> >                                         complete: function (jsondata, stat){
> >                                                         if(stat=="success"){
>
> >                                                         var thegrid = 
> > jQuery("#list3")[0];
> >                                                         
> > thegrid.addJSONData(eval("("+jsondata.responseText+")"));
> >                                                                         
> > alert("yes");
> >                                                                         }
> >                                                                 else{
> >                                                                         
> > alert("no");
> >                                                                         }
> >                                                                 } // end 
> > complete
> >                                                 }); // end ajax
> >                                                 }, // end datatype
>
> >                         colNames:['Product No', 'Name', 'type'],
>
> >                         colModel:[
>
> >                                 {name:'product_id',index:'product_id', 
> > width:75},
>
> >                                 {name:'name',index:'name', width:100},
>
> >                                 {name:'type',index:'type', width:100},
>
> >                                 ],
>
> >                         pager: jQuery('#pager3'),
>
> >                         rowNum:10,
>
> >                         rowList:[10,20,30],
>
> >                         imgpath: 'themes/sand/images',
>
> >                         sortname: 'id',
>
> >                         viewrecords: true,
>
> >                         sortorder: "asc"
> >                         });
>
> >                         },  //end ondblClickRow function
>
> > On Apr 8, 3:50 am, Tony <t...@trirand.com> wrote:
>
> > > Hello again,
> > > Sorry missed that you have datatype as function.
> > > The 2 should be just
>
> > > var x;
> > > .....
> > > ondblClickRow: function(id){
> > > x =id;
> > > .....
> > > jQuery("#list3").trigger("reloadGrid");
> > > ..
>
> > > }
>
> > > On Apr 8, 10:43 am, Tony <t...@trirand.com> wrote:
>
> > > > Hello,
> > > > Basically jqGrid first check if the grid exists.
> > > > If the grid does not exists the plugin create the grid and data is
> > > > populated.
> > > > If the grid exists nothing is happen.
> > > > In other words you try to call every time jqGrid on already created
> > > > grid.
> > > > To avoid this there are a lot of scenarious.
> > > > 1. Create a empty second grid and hide them (if you want)
> > > > 2. Then after every double click do something like this
>
> > > > jQuery("#list3").setGridParam({url:'get_services.php?name='+x}).trigger
> > > > ("reloadGrid")
>
> > > > Best Regards
> > > > Tony
>
> > > > On Apr 7, 10:21 pm, "NatkeeranL.K." <natkee...@gmail.com> wrote:
>
> > > > > Hello:
>
> > > > > I am trying to develop a similar functionality as here:http://
> > > > > koshersavings.ca/SelectItems.php
>
> > > > > When the user to clicks an row item, I want items to be loaded based
> > > > > on the selection, dynamically.
>
> > > > > I am trying to do the same, but usingjqgrid, and ajax.
>
> > > > > The current code is here:  (also note 
> > > > > below)http://pssnet.com/~devone/ajqtable/summary35.html
>
> > > > > Basically, when the user double clicks it loads a corresponding
> > > > > table.  But, when they select another, it will not reloaded.  Any help
> > > > > appreciated.  Thanks.
>
> > > > > Regards,
> > > > > Nat
>
> > > > >     ondblClickRow: function(id){
> > > > >                 var x = id;
> > > > >                 alert("You double click row with id: "+id);
>
> > > > >                         // Load Dynamic Data
> > > > >                 jQuery("#list3").jqGrid({
> > > > >                                 datatype: function(postdata){
> > > > >                                         jQuery.ajax({
> > > > >                                         
> > > > > url:'get_services.php?name='+x,
> > > > >                                         data:postdata,
>
> > > > >                                         datatype: "json",
> > > > >                                         complete: function (jsondata, 
> > > > > stat){
> > > > >                                                         
> > > > > if(stat=="success"){
> > > > >                                                         var thegrid = 
> > > > > jQuery("#list3")[0];
> > > > >                                                         
> > > > > thegrid.addJSONData(eval("("+jsondata.responseText+")"));
> > > > >                                                                       
> > > > >   alert("yes");
> > > > >                                                                       
> > > > >   }
> > > > >                                                                 else{
> > > > >                                                                       
> > > > >   alert("no");
> > > > >                                                                       
> > > > >   }
> > > > >                                                                 } // 
> > > > > end complete
> > > > >                                                 }); // end ajax
> > > > >                                                 }, // end datatype
>
> > > > >                         colNames:['Product No', 'Name', 'type'],
>
> > > > >                         colModel:[
>
> > > > >                                 
> > > > > {name:'product_id',index:'product_id', width:75},
>
> > > > >                                 {name:'name',index:'name', width:100},
>
> > > > >                                 {name:'type',index:'type', width:100},
>
> > > > >                                 ],
>
> > > > >                         pager: jQuery('#pager3'),
>
> > > > >                         rowNum:10,
>
> > > > >                         rowList:[10,20,30],
>
> > > > >                         imgpath: 'themes/sand/images',
>
> > > > >                         sortname: 'id',
>
> > > > >                         viewrecords: true,
>
> > > > >                         sortorder: "asc"
> > > > >                         });
>
> > > > >                         },  //end ondblClickRow function

Reply via email to