I am really struggling with deleting items from a grid, see my code below. Everything loads OK but when I click the 'Delete Selected' button the file that gets fetched (in firefox inspector) is not 'DeleteItem.php' as I would expect but DbaseConnection.php - although the correct parameters are sent. Can anyone suggest some pointers, why would the dataURL be fetched again when I've asked for removeData?
isc.DataSource.create({
ID: "DSToDo",
fields:[
{name:"TaskToDoID", title:"ID", width:50, type:"text"},
{name:"TaskToDoDate", title:"Date"},
{name:"TaskToDoJobNo", title:"Job No"},
{name:"TaskToDoJobTitle", title:"Job Title"}
],
dataFormat: "json",
dataURL: "DbaseConnection.php",
removeDataURL:"DeleteItem.php",
addDataURL:"<notYetSet>",
updateDataURL:"<notYetSet>"
})
isc.ListGrid.create({
ID: "LGtoDo",
width:900, height:300,
dataSource: "DSToDo",
autoFetchData: true,
canEdit: true,
canReorderFields: true
})
isc.IButton.create({
left:340, top:340, title:"Delete Selected",
click: function () {LGtoDo.removeData(LGtoDo.getSelectedRecord());
}
});
isc.DataSource.create({
ID: "DSToDo",
fields:[
{name:"TaskToDoID", title:"ID", width:50, type:"text"},
{name:"TaskToDoDate", title:"Date"},
{name:"TaskToDoJobNo", title:"Job No"},
{name:"TaskToDoJobTitle", title:"Job Title"}
],
dataFormat: "json",
dataURL: "DbaseConnection.php",
removeDataURL:"DeleteItem.php",
addDataURL:"<notYetSet>",
updateDataURL:"<notYetSet>"
})
isc.ListGrid.create({
ID: "LGtoDo",
width:900, height:300,
dataSource: "DSToDo",
autoFetchData: true,
canEdit: true,
canReorderFields: true
})
isc.IButton.create({
left:340, top:340, title:"Delete Selected",
click: function () {LGtoDo.removeData(LGtoDo.getSelectedRecord());
}
});
Comment