Note that there are some explanatory texts on larger screens.

plurals
  1. POjquery jqgrid list delete data aftersubmit
    primarykey
    data
    text
    <p>What I want to ask is that I have a jqgrid list and i want to get error message on screen in case deletion fails. Here is my code:</p> <pre><code>&lt;html&gt; &lt;body&gt; &lt;script type="text/javascript" charset="utf-8"&gt; $(document).ready(function() { jQuery("#list").jqGrid({ url:'../listeAjax', datatype: "json", colNames:['Id','Hizmet adı', 'Sektörler', 'Durum', 'Düzenle'], colModel:[ {name:'onto_data_id',index:'onto_data_id', width:55, editable: false}, {name:'baslik',index:'baslik', editable:true, editrules:{required:true}, formoptions:{ elmprefix:"(*)"}}, {name:'sektor_list',index:'sektor_list', editable:false}, {name:'is_active',index:'is_active', align: 'center', editable:true, stype:'select', editoptions:{value:":All;1:&lt;?php echo lang('title_aktif')?&gt;;0:&lt;?php echo lang('title_pasif')?&gt;", defaultValue:1}, edittype:"select" }, {name:'duzenle',index:'duzenle', align: 'center', sortable:false, search: false, editable:false} ], rowNum: &lt;?php echo DEFAULT_GRID_ROWNUM; ?&gt;, rowList:[100,200,400,800], pager: '#pager', sortname: 'onto_data_id', viewrecords: true, sortorder: "desc", multiselect: true, width: 800, height: "100%", editurl: '../islemAjax', caption: "Hizmetler", mtype: "GET", postData:{parent_id: '&lt;?php echo $parent_id; ?&gt;', parent_type: '&lt;?php echo $parent_type; ?&gt;'} }); jQuery("#list").jqGrid('navGrid','#pager', {edit:true, add:true, del:true, search:false}, {closeOnEscape:true, bottominfo:"&lt;?php langValue('info_yildizlialanlar'); ?&gt;",editData: { parent_id: function() { return '&lt;?php echo $parent_id; ?&gt;'; }, parent_type: function() { return '&lt;?php echo $parent_type; ?&gt;'; }, tur: function() { return '&lt;?php echo ONTO_TYPE_HIZMET; ?&gt;'; } }}, { beforeSubmit: function(postdata, formid){ var message; $.ajax( { type : 'POST', dataType : 'json', url : "&lt;?php echo URL_YONETIMDATACONTROL; ?&gt;", data : 'baslik='+postdata.baslik + '&amp;parent_id=' + &lt;?php echo $parent_id; ?&gt; + '&amp;parent_type=' + &lt;?php echo $parent_type; ?&gt; + '&amp;onto_type=' + &lt;?php echo ONTO_TYPE_HIZMET ; ?&gt;, async : false, success : function(result) { if(result.status == true) { complete = true; } else { complete = false; } message = result.message; }, error: function (data, status, e) { complete = false; message = e; } }); return [complete, message, ""]; }, closeOnEscape:true, bottominfo:"&lt;?php langValue('info_yildizlialanlar'); ?&gt;",editData: { parent_id: function() { return '&lt;?php echo $parent_id; ?&gt;'; }, parent_type: function() { return '&lt;?php echo $parent_type; ?&gt;'; }, tur: function() { return '&lt;?php echo ONTO_TYPE_HIZMET; ?&gt;'; } }}, {delData: { parent_id: function() { return '&lt;?php echo $parent_id; ?&gt;'; }, parent_type: function() { return '&lt;?php echo $parent_type; ?&gt;'; } }}, {} ); jQuery("#list").jqGrid('filterToolbar'); } ); &lt;/script&gt; &lt;h1&gt; &lt;?php echo langValue('title_hizmetliste'); ?&gt; &lt;?php if(isset($sektor_baslik)) { echo '(' . $sektor_baslik . ')'; } ?&gt; &lt;a href="&lt;?php echo URL_YONETIMHIZMETEKLE; ?&gt;" title="&lt;?php echo langValue('form_ekle')?&gt;" class="tooltip"&gt; &lt;img src="&lt;?php echo PATH_MEDIA_IMG_YONETIM; ?&gt;icons/8_48x48.png" alt="" /&gt; &lt;/a&gt; &lt;/h1&gt; &lt;div class="pad20"&gt; &lt;?php if(isset($info)) { ?&gt; &lt;div class="message success close"&gt; &lt;h2&gt;&lt;?php echo $info; ?&gt;&lt;/h2&gt; &lt;/div&gt; &lt;?php } ?&gt; &lt;!-- Tabs --&gt; &lt;div id="tabs"&gt; &lt;!-- First tab --&gt; &lt;div id="tabs-1"&gt; &lt;table id="list"&gt;&lt;/table&gt; &lt;div id="pager"&gt;&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>I inserted afterSubmit but it returns nothing. Moreover, when I alert a text in afterSubmit, nothing happens. Here is the aftersubmit code I tried:</p> <pre><code>afterSubmit : function(response, postdata) { alert("test"); return [success,message,new_id] } </code></pre> <p>What is wrong in here?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload