Welcome Guest, Not a member yet? Register   Sign In
HELP: item is null
#1

[eluser]cestaz18[/eluser]
i have joint table sec_company access table where it has user id and company id joint together where the sec company access id is the one i call to show the detail list data of my master jqgrid table which is the sec user table..

the scene where i have an add delete edit operation in my detail list table which the company detail data..when i have to add data in my company table..it succesfully add but if i refresh the table it will hide and said that no record found..

i think the problem is..there is no company id save in my sec_companyaccess table where its id the one i call on to show the company detail data....

heres my code..

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",
        
    //cess code added
         ondblClickRow: 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',
         editurl: root + mod + '/detailpost',    
         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:250, 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"

        }
);
    jQuery("#detFlex1").jqGrid('navGrid','#pager2',
        {search:false},//search options
        {view:false}, //view options
        {height:150,reloadAfterSubmit:false, jqModal:false, closeOnEscape:true, bottominfo:"Fields marked with (*) are required"}, // edit options
        {height:150,reloadAfterSubmit:false,jqModal:false, closeOnEscape:true, bottominfo:"Fields marked with (*) are required", closeAfterAdd: true}, // add options
        {height:150,reloadAfterSubmit:false,jqModal:false, closeOnEscape:true} // del options
        );


Messages In This Thread
HELP: item is null - by El Forum - 02-14-2010, 10:03 PM
HELP: item is null - by El Forum - 02-14-2010, 10:04 PM
HELP: item is null - by El Forum - 02-14-2010, 10:04 PM
HELP: item is null - by El Forum - 02-14-2010, 10:12 PM



Theme © iAndrew 2016 - Forum software by © MyBB