grid not loaded

Questionsgrid not loaded
umam asked 11 years ago

hi,

i have a problem with my grid. when i developed it and ran it on my localhost , it works fine. but after i hosted it, the grid isn't loaded at all.

thanks

6 Answers
umam answered 11 years ago

the grid comes out as this (but doesn't load on page):

<script>
jQuery(document).ready(function(){ var lastSel;var grid_list1 = jQuery("#list1").jqGrid({"datatype":"json","rowNum":10,"width":900,"height":350,"rowList":[10,20,30],"viewrecords":true,"scrollrows":true,"url":"http://sispal.org/index.php/home/grid_anggota&quot;,"editurl":"http://sispal.org/index.php/home/grid_anggota&quot;,"cellurl":"http://sispal.org/index.php/home/grid_anggota&quot;,"scroll":0,"sortable":true,"cellEdit":false,"add_options":{"closeAfterAdd":true},"edit_options":{"closeAfterEdit":true},"caption":"Member Record","multiselect":true,"export":{"format":"pdf","filename":"my-file","heading":"Invoice Details","orientation":"landscape","range":"filtered"},"sortname":"NIA","sortorder":"desc","autowidth":true,"colModel":[{"title":"NIM","name":"nim","width":"100","editable":true,"align":"left","search":true,"index":"nim"},{"title":"Foto","name":"foto","width":"100","align":"center","search":false,"sortable":false,"link":"http://sispal.org/uploads/{nim}.jpg","linkoptions":"target='_self'","default":"<img height=75 src=' http://sispal.org/uploads/{nim}.jpg'>","index":"foto"},{"title":"Nama","name":"nama","width":"100","editable":true,"align":"left","search":true,"index":"nama"},{"title":"Jenis kelamin","name":"gender","width":"100","editable":true,"align":"left","search":true,"edittype":"select","editoptions":{"value":"pria:pria ;wanita:wanita"},"hidden":true,"editrules":{"edithidden":true},"index":"gender"},{"title":"Jurusan","name":"jurusan","width":"100","editable":true,"align":"left","search":false,"index":"jurusan"},{"title":"Angkatan","name":"angkatan","width":"100","editable":true,"align":"left","search":false,"index":"angkatan"},{"title":"Tlp/HP","name":"telepon","width":"100","editable":true,"align":"left","search":false,"hidden":true,"editrules":{"edithidden":true},"index":"telepon"},{"title":"Tempat lahir","name":"tempat_lahir","width":"100","editable":true,"align":"left","search":false,"hidden":true,"editrules":{"edithidden":true},"index":"tempat_lahir"},{"title":"Tanggal lahir","name":"tgl_lahir","width":"50","editable":true,"editoptions":{"size":20,"dataInit":function(o){link_dtpicker(o);}},"hidden":true,"editrules":{"required":true,"edithidden":true},"formatter":"date","index":"tgl_lahir","formatoptions":{"srcformat":"Y-m-d","newformat":"Y-m-d"}},{"title":"Alamat asal","name":"alamat_asal","width":"100","editable":true,"align":"left","search":false,"hidden":true,"editrules":{"edithidden":true},"index":"alamat_asal"},{"title":"Alamat di Jember","name":"alamat_jbr","sortable":false,"search":false,"editable":true,"edittype":"textarea","editoptions":{"rows":2,"cols":20},"hidden":true,"editrules":{"edithidden":true},"index":"alamat_jbr"},{"title":"NIA","name":"nia","width":"100","editable":true,"align":"left","search":true,"hidden":true,"editrules":{"edithidden":true},"index":"nia"},{"title":"Nama lapang","name":"namalpg","width":"100","editable":true,"align":"left","search":true,"hidden":true,"editrules":

umam answered 11 years ago

{"edithidden":true},"index":"namalpg"},{"title":"Peminatan","name":"minat","width":"100","editable":true,"align":"left","search":false,"hidden":true,"editrules":{"edithidden":true},"index":"minat"},{"title":"Status","name":"status","width":"100","editable":true,"align":"left","search":true,"edittype":"select","editoptions":{"value":"CA:CA ;AM:AM ;AB:AB ;ALB:ALB"},"hidden":true,"editrules":{"edithidden":true},"index":"status"},{"name":"act","align":"center","index":"act","width":"30","sortable":false,"search":false,"title":"Action","hidden":true}],"colNames":["NIM","Foto","Nama","Jenis kelamin","Jurusan","Angkatan","Tlp/HP","Tempat lahir","Tanggal lahir","Alamat asal","Alamat di Jember","NIA","Nama lapang","Peminatan","Status","Action"],"pager":"#list1_pager","jsonReader":{"repeatitems":false,"id":"0"},'gridComplete': function(){ var ids = jQuery('#list1').jqGrid('getDataIDs');for(var i=0;i < ids.length;i++){ var cl = ids[i]; be = ' <a title="Edit this row" href="javascript:void(0);" onclick="jQuery('#list1').editRow(''+cl+'',true); jQuery(this).parent().hide(); jQuery(this).parent().next().show(); ">Edit</a>'; de = ' | <a title="Delete this row" href="javascript:void(0);" onclick="jQuery('#list1').delGridRow(''+cl+''); ">Delete</a>'; se = ' <a title="Save this row" href="javascript:void(0);" onclick="jQuery('#list1').saveRow(''+cl+''); jQuery(this).parent().hide(); jQuery(this).parent().prev().show();">Save</a>'; ce = ' | <a title="Restore this row" href="javascript:void(0);" onclick="jQuery('#list1').restoreRow(''+cl+''); jQuery(this).parent().hide(); jQuery(this).parent().prev().show();">Cancel</a>'; if (ids[i] == 'new_row') { se = ' <a title="Save this row" href="javascript:void(0);" onclick="jQuery('#list1_ilsave').click(); jQuery(this).parent().hide(); jQuery(this).parent().prev().show();">Save</a>'; ce = ' | <a title="Restore this row" href="javascript:void(0);" onclick="jQuery('#list1_ilcancel').click(); jQuery(this).parent().hide(); jQuery(this).parent().prev().show();">Cancel</a>'; jQuery('#list1').jqGrid('setRowData',ids[i],{act:'<span style=display:none id="edit_row_'+cl+'">'+be+de+'</span>'+'<span id="save_row_'+cl+'">'+se+ce+'</span>'});}else jQuery('#list1').jqGrid('setRowData',ids[i],{act:'<span id="edit_row_'+cl+'">'+be+de+'</span>'+'<span style=display:none id="save_row_'+cl+'">'+se+ce+'</span>'});} },'ondblClickRow':function(id) { if(id && id!==lastSel){ jQuery('#list1').restoreRow(lastSel); jQuery('#edit_row_'+lastSel).show();jQuery('#save_row_'+lastSel).hide(); lastSel=id; } jQuery('#list1').editRow(id, true, function(){}, function(){ jQuery('#edit_row_'+id).show();jQuery('#save_row_'+id).hide();return true;},null,null,null,null, function(){ jQuery('#edit_row_'+id).show();jQuery('#save_row_'+id).hide();return true;}); jQuery('#edit_row_'+id).hide();jQuery('#save_row_'+id).show();},'onSelectRow': function(id) { }}); jQuery("#list1").jqGrid('navGrid','#list1_pager', { edit: true, add: true, del: true }, {"closeAfterEdit":true}, {"closeAfterAdd":true}, {}, {multipleSearch:true}); jQuery("#list1").jqGrid('filterToolbar',{stringResult: true,searchOnEnter : false}); jQuery("#list1").jqGrid('navButtonAdd',"#list1_pager",{caption:"Columns",title:"Hide/Show Columns", buttonicon :'ui-icon-note', onClickButton:function(){ jQuery("#list1").jqGrid('setColumns'); } }); function link_dtpicker(el) { setTimeout(function(){ if(jQuery.ui) { if(jQuery.ui.datepicker) { jQuery(el).after('<button>Calendar</button>').next().button({icons:{primary: 'ui-icon-calendar'}, text:false}).css({'font-size':'69%'}).click(function(e){jQuery(el).datepicker('show');return false;});jQuery(el).datepicker({"disabled":false,"dateFormat":"yy-mm-dd"});jQuery('.ui-datepicker').css({'font-size':'69%'});} }},100);}jQuery("#list1").jqGrid('gridResize',{}); });
</script>

umam answered 11 years ago

PS : I use Codeigniter Framework

Abu Ghufran answered 11 years ago

Please check using firebug > net, for any 404 errors.
Also check In Codeigniter, the htaccess mod_rewrite param of QSA (query string append) is disabled. You might need to enable it in CI.

Meeti answered 11 years ago

Hi,
I have this error print when I try to exprt my grid to pdf:

TCPDF ERROR: Some data has already been output, can't send PDF file

Please help me with a solution!

Abu Ghufran answered 11 years ago

Make sure you don't have white space character OR any html code before $grid->render() function call.

Your Answer

6 + 5 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?