How do you edit and update a row? Please show an example to demonstrate your issue.
1. First i open 2 datagrid with different tab browserdatagrid scipt :
$(function() {
var datanya = <?php echo json_encode($_POST); ?>;
var type = '<?=$TANDA; ?>';
$("#result").datagrid({
//url : $.post('<?= site_url() ?>/tiket/searchResult/',datanya,'success'),
url : '<?= site_url() ?>/masterp/searchResult/type/'+type,
method : 'POST',
queryParams: datanya,
columns:[[
{field:'KD_Cust',title:'KD_Cust',sortable:true},
{field:'Nama_Cust',title:'Nama_Cust',sortable:true},
{field:'Alamat',title:'Alamat',sortable:true},
{field:'Telp',title:'Telp',sortable:true},
{field:'CP',title:'CP',sortable:true},
{field:'Nama_CustType',title:'Cust Type',sortable:true},
{field:'IsAktif',title:'IsAktif',sortable:true,formatter:formatPrice}
]],
toolbar:"#toolbard",
pagination:"true",
nowrap: "false",
pageSize: 10,
fitcolumns: "true",
rownumbers: "false",
width: "auto",
height: "300",
singleSelect: "true"
})
});
2. Then i edited the data from first datagrid, example before name field is AAAA, after edit is AAAABBBBscript edit function EDITDatas(){
var row = $('#result').datagrid('getSelected');
if (row){
$('#dlgad').dialog('open').dialog('setTitle','Edit Data Employee');
row.menumm="<?=$menunameid;?>";
$('#fmad').form('load',row);
url = '<?=site_url() ?>/masterp/editocustomerr/ID/'+row.Cust_ID;
}
}
script edit form <div id="dlgad" class="easyui-dialog" style="width:380px;height:auto;padding:10px 20px"
closed="true" buttons="#dlgad-buttons" data-options="modal:true,iconCls:'icon-save',resizable:true,closable:false ">
<div class="ftitle">Data Customer</div>
<form id="fmad" method="post" action="<?=site_url() ?>/masterp/editocustomerr/" novalidate>
<div class="fitem">
<label>Kode_Cust</label>
<input name="KD_Cust" id="KD_Cust" style="width:200px;" class="easyui-validatebox" required="true">
</div>
<div class="fitem">
<label>Nama</label>
<input name="Nama_Cust" id="Nama_Cust" style="width:200px;" class="easyui-validatebox" required="true">
<input name="menumm" id="menumm" type="hidden" value="<?=$menunameid;?>"/>
</div>
<div class="fitem">
<label>Alamat</label>
<input name="Alamat" id="Alamat" style="width:200px;">
</div>
<div class="fitem">
<label>phone</label>
<input name="Telp" id="Telp" style="width:200px;">
</div>
<div class="fitem">
<label>CP</label>
<input name="CP" id="CP" style="width:200px;" >
</div>
<label id="resultzen">
<div class="fitem">
<label>Customer Type</label>
<select name="m_CustType_ID" id="m_CustType_ID" class="easyui-combobox" required="true" >
<?
foreach ($custipe as $resulejs) {
?>
<option value="<?= $resulejs['CustType_ID']; ?>"><?= $resulejs['KD_CustType']; ?> -- <?= $resulejs['Nama_CustType']; ?></option>
<?php
}
?>
</select>
</div>
</label>
<div class="fitem">
<label>IsAktif</label>
<input type="checkbox" value="1" name="IsAktif" id="IsAktif" >
</div>
</form>
</div>
<div id="dlgad-buttons">
<a href="#" class="easyui-linkbutton" iconCls="icon-ok" onclick="saveEmp()">Save</a>
<a href="#" class="easyui-linkbutton" iconCls="icon-cancel" onclick="
$.messager.confirm('Confirm', 'Closed Without Saved?', function(r){
if (r){
javascript:$('#dlgad').dialog('close')
}
});
">Close</a>
<a href="#" class="easyui-linkbutton" iconCls="icon-undo" onclick="refreshdif()">Reload</a>
</div>
3. I saved the data, then i want see the data from second datagrid with the same id key..but in the second datagrid the data not update, the value data in name field still AAAA, not AAAABBBB
Thank you