Hello @all:
Any Ideas why this not work, i become no alert?
$('#servicegrid').datagrid({
nowrap: false,
striped: true,
collapsible:true,
url:'/manage/json.php',
pagination: true,
singleSelect: true,
sortName: 'sort',
sortOrder: 'ASC',
fitColumns: true,
idField:'id',
pageSize:30,
pageNumber: 1,
queryParams: {"action": "service"},
columns:[[
{field:'id',title:'ID',width:20, sortable: 'true'},
{field:'short',title:'Abk.', width:30, sortable: true, editor: 'text' },
{field:'long',title:'Service', width:100, sortable: true, editor: 'text' },
{field:'dict',title:'Beschreibung', width:160, sortable: true, editor: 'text' },
{field:'sort',title:'Sortierung', width:120, sortable: true, editor: 'numberspinner'},
{field:'action',title:'', width:100,
formatter:function(value,row,index){
if(row.editing){
var link = '<a href="#" onclick="saverow('+index+')">Speichern</a> ';
link += '<a href="#" onclick="cancelrow('+index+')">Abrechen</a>';
}
else {
var link = '<a href="#" onclick="editrow('+index+')">Ändern</a> ';
link += '<a href="#" onclick="deleterow('+index+')">Löschen</a>';
}
return link;
}
}
]],
onBeforeEdit:function(index,row){
row.editing = true;
updateActions(index);
},
onAfterEdit:function(index,row){
row.editing = false;
updateActions(index);
},
onCancelEdit:function(index,row){
row.editing = false;
//updateActions(index);
},
});
var p = $('#servicegrid').datagrid('getPager');
$(p).pagination({
onBeforeRefresh:function(){
alert('before refresh');
}
});
$('#servicegrid').datagrid({
nowrap: false,
striped: true,
collapsible:true,
url:'/manage/json.php',
pagination: true,
singleSelect: true,
sortName: 'sort',
sortOrder: 'ASC',
fitColumns: true,
idField:'id',
pageSize:30,
pageNumber: 1,
queryParams: {"action": "service"},
columns:[[
{field:'id',title:'ID',width:20, sortable: 'true'},
{field:'short',title:'Abk.', width:30, sortable: true, editor: 'text' },
{field:'long',title:'Service', width:100, sortable: true, editor: 'text' },
{field:'dict',title:'Beschreibung', width:160, sortable: true, editor: 'text' },
{field:'sort',title:'Sortierung', width:120, sortable: true, editor: 'numberspinner'},
{field:'action',title:'', width:100,
formatter:function(value,row,index){
if(row.editing){
var link = '<a href="#" onclick="saverow('+index+')">Speichern</a> ';
link += '<a href="#" onclick="cancelrow('+index+')">Abrechen</a>';
}
else {
var link = '<a href="#" onclick="editrow('+index+')">Ändern</a> ';
link += '<a href="#" onclick="deleterow('+index+')">Löschen</a>';
}
return link;
}
}
]],
onBeforeEdit:function(index,row){
row.editing = true;
updateActions(index);
},
onAfterEdit:function(index,row){
row.editing = false;
updateActions(index);
},
onCancelEdit:function(index,row){
row.editing = false;
//updateActions(index);
},
});
var p = $('#servicegrid').datagrid('getPager');
$(p).pagination({
onBeforeRefresh:function(){
alert('before refresh');
}
});