hello again,
just to the point.
i want to some column/editor when editing a row with some condition.
here is how defined it:
onBeginEdit:function(index,row){
// start list editor yang memiliki rules
var transport_mode = $(this).datagrid('getEditor',{index:index,field:'transport_mode_id'});
var port_ori = $(this).datagrid('getEditor',{index:index,field:'port_id_ori'});
var port_dest = $(this).datagrid('getEditor',{index:index,field:'port_id_dest'});
var zone_ori = $(this).datagrid('getEditor',{index:index,field:'zone_id_ori'});
var zone_dest = $(this).datagrid('getEditor',{index:index,field:'zone_id_dest'});
var nw = $(this).datagrid('getEditor',{index:index,field:'nw'});
var gw = $(this).datagrid('getEditor',{index:index,field:'gw'});
// stop list editor yang memiliki rules
// start dapatkan options column
var port_ori_opt = $(this).datagrid('getColumnOption','port_id_ori'); // in this i test to hide port_id_ori column when begin editing.
port_ori_opt.hidden = true;
console.log(port_ori_opt);
// stop dapatkan options column
$(port_ori.target).combogrid({
onChange:function(newValue,oldValue){
var port_dest_val = $(port_dest.target).combogrid('getValue');
var port_ori_val = $(this).combogrid('getValue');
if (port_ori_val != "" && port_dest_val != ""){
if (newValue == port_dest_value){
$.messager.alert('Info','Port Ori and Port Dest cannot be same.','info');
$(this).combogrid('setValue','');
$(this).focus();
}
}
}
});
$(port_dest.target).combogrid({
onChange:function(newValue,oldValue){
var port_dest_val = $(this).combogrid('getValue');
var port_ori_val = $(port_ori.target).combogrid('getValue');
if (port_dest_val != "" && port_ori_val != ""){
if (newValue == port_ori_val){
$.messager.alert('Info','Port Ori and Port Dest cannot be same.','info');
$(this).combogrid('setValue','');
$(this).focus();
}
}
}
});
$(nw.target).numberbox({
onChange:function(newValue,oldValue){
var nw_val = $(this).numberbox('getValue');
var gw_val = $(this).numberbox('getValue');
if (nw_val != "" && gw_val != ""){
if (!isNaN(gw_val) && !isNaN(nw_val)){
if (parseFloat(nw_val) > parseFloat(gw_val)){
$.message.alert('Info',"NW must be lower than GW",'info');
$(this).focus();
$(this).numberbox('setValue','0');
}
}
}
}
});
}
but it's not working, port_id_ori not hidden at all.
whats wrong with my code?
many thanks for the answer