SOLVED:[help]Jqgrid master detail list in another page!

#4
[eluser]cestaz18[/eluser]
Master-Detail jqGrid

this is the solution after 1000 years thinking and dreaming of code...hehehe^^


VIEW (home.php)

Code:
<div class="dpane">
                    <table id="listFlex" class="listFlex" cellpadding="0" cellspacing="0"></table>
                    <div id="pager" class="scroll" style="text-align: center;"></div>
            </div>...

<div class="dpane">
                           <table id="detFlex1" class="detFlex"></table>
                        <div id="pager2" class="scroll" style="text-align: center;"></div>                      
                    </div>

VIEW (script.js)

Code:
$(".listFlex").jqGrid({
         url: root + mod + '/listview',
          editurl: root + mod + '/post',        
          sortable: true,
         datatype: "json",
         mtype: 'POST',
         colNames:['','Username','Lastname', 'Firstname','Middle Initial'],
         colModel:[
                       {name:'user_id', index: 'item', hidden: true},
                      {name:'username',index:'username', width:80, align:"left", editable:true},
                    {name:'last_name', index: 'last_name', width:80, editable: true},
                       {name:'first_name',index:'first_name', width:100,align:"left",editable:true},
                    {name:'middle_initial', index: 'middle_initial', width:80, editable: true}
                    
               ],
         rowNum:10,
         rowList:[10,20,30],
         rownumbers: true,
         pager: '#pager',
         sortname: 'username',
         viewrecords: true,
         sortorder: 'asc',
         autowidth: true,

                 height: "200",
         caption:"User Role List -Dean",
onSelectRow: function(ids) {
    if(ids == null) {
        ids=0;
        if(jQuery("#detFlex1").jqGrid('getGridParam','records') >0 )
        {
            jQuery("#detFlex1").jqGrid('setGridParam',{url:root + mod + '/detaillistview/' + ids,page:1});
            jQuery("#detFlex1").jqGrid('setCaption',"Detail: "+ids)
            .trigger('reloadGrid');
            $('.toolbar a[title=Header]').trigger('click');                
            viewdb(ids);
        }
    } else {
        jQuery("#detFlex1").jqGrid('setGridParam',{url:root + mod + '/detaillistview/' + ids,page:1});
        jQuery("#detFlex1").jqGrid('setCaption',"Detail: "+ids)
        .trigger('reloadGrid');
        $('.toolbar a[title=Header]').trigger('click');                
        viewdb(ids);
        }
    }
});


$("#detFlex1").jqGrid({
         url: root + mod + '/detaillistview',
         datatype: "json",
         mtype: 'POST',
         colNames:['','Company Code','Company Name', ''],
         colModel:[
                   {name:'company_access_id', index: 'company_access_id', hidden: true},
                      {name:'company_code',index:'company_code', width:200, align:"left", editable:true},
                    {name:'company_name', index: 'company_name', width:250, editable: true},
                   {name:'company_id',index:'company_id', hidden: true}
               ],
         rowNum:10,
         rowList:[10,20,30],
         rownumbers: true,
         pager: '#pager2',
         sortname: 'company_code',
         viewrecords: true,
         sortorder: 'asc',
         autowidth: true,
         height: "100",
         caption:"Details"

        }
);


Messages In This Thread
SOLVED:[help]Jqgrid master detail list in another page! - by El Forum - 01-28-2010, 01:59 AM
SOLVED:[help]Jqgrid master detail list in another page! - by El Forum - 01-28-2010, 02:03 AM
SOLVED:[help]Jqgrid master detail list in another page! - by El Forum - 01-28-2010, 02:04 AM
SOLVED:[help]Jqgrid master detail list in another page! - by El Forum - 02-01-2010, 11:49 PM
SOLVED:[help]Jqgrid master detail list in another page! - by El Forum - 02-01-2010, 11:52 PM
SOLVED:[help]Jqgrid master detail list in another page! - by El Forum - 02-01-2010, 11:53 PM
SOLVED:[help]Jqgrid master detail list in another page! - by El Forum - 02-01-2010, 11:54 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.