Show Posts
|
Pages: [1]
|
2
|
General Category / EasyUI for jQuery / Problem to edit datagrid
|
on: April 26, 2012, 06:48:11 AM
|
I've tried to use tutorial example for inline datagrid editing but seems not work, i see the field action added but pushing edit or cancel nothing happen, any idea? here follow my code: $("#tt").datagrid({ title: "log", singleSelect:true, idField:'contratto', url: stringa, columns: [[{field:'utente',title:'Utente', width:80, sortable:true, editor:'text'}, {field:'contratto',title:'Contratto', width:80, sortable:true, editor:'text'}, {field:'login',title:'Login', width:80, sortable:true, editor:'text'}, {field:'piattaforma',title:'Piattaforma', width:80, sortable:true, editor:'text'}, {field:'azione',title:'Azione', width:80, sortable:true, editor:'text'}, {field:'data',title:'Data - ora', width:80, sortable:true, editor:'text'}, {field:'note',title:'Note', width:80, sortable:true, editor:'text'}, {field:'action',title:'Action',width:70,align:'center', formatter:function(value,row,index){ if (row.editing){ var s = '<a href="#" onclick="saverow('+index+')">Save</a> '; var c = '<a href="#" onclick="cancelrow('+index+')">Cancel</a>'; return s+c; } else { var e = '<a href="#" onclick="editrow('+index+')">Edit</a> '; var d = '<a href="#" onclick="deleterow('+index+')">Delete</a>'; return e+d; } } } ]], onBeforeEdit:function(index,row){ row.editing = true; updateActions(); }, onAfterEdit:function(index,row){ row.editing = false; updateActions(); }, onCancelEdit:function(index,row){ row.editing = false; updateActions(); }, pagination:true }); function updateActions(){ var rowcount = $('#tt').datagrid('getRows').length; for(var i=0; i<rowcount; i++){ $('#tt').datagrid('updateRow',{ index:i, row:{action:''} }); } } function editrow(index){ $('#tt').datagrid('beginEdit', index); } function deleterow(index){ $.messager.confirm('Confirm','Are you sure?',function(r){ if (r){ $('#tt').datagrid('deleteRow', index); } }); } function saverow(index){ $('#tt').datagrid('endEdit', index); } function cancelrow(index){ $('#tt').datagrid('cancelEdit', index); }
thanks in advance ciao h.
|
|
|
5
|
General Category / EasyUI for jQuery / Problem on view datagrid
|
on: April 23, 2012, 08:38:30 AM
|
Hi everybody! I've a problem on view a datagrid in my intranet, data are loaded correctly but column header remain half hidden can you explain me how to resolve it? thanks in advance. here follow my symple code: $("#tt").datagrid({ title: "log", url: "./php/log.php", columns: [[{field:'utente',title:'Utente'}, {field:'contratto',title:'Contratto'}, {field:'login',title:'Login'}, {field:'piattaforma',title:'Piattaforma'}, {field:'azione',title:'Azione'}, {field:'data',title:'Data - ora'}, {field:'note',title:'Note'}, ]], pagination:true });
and attached a printscreen of the result
|
|
|
|