내 페이지에 ItemFileWriteStore
이 있습니다. 내 DataGrid
에있는 행을 클릭하면 그 행의 ID를 얻을 수 있지만 그 다음에 해당 ID를 사용하여 fetchItemByIdentity
을 시도하면 항상 null
을 반환합니다. 왜이게 될 수 있니?fetchItemByIdentity()가 예상대로 작동하지 않습니다.
Dojo 1.5를 사용하고 있습니다.
function getRemoveFormatter(id) {
return '<a href="#" onclick="deleteItem(' + id + ');return false;"><img src="/images/icons/delete.png" /></a>';
}
function deleteItem(id) {
console.log(id);
window.grid.store.fetchItemByIdentity({
identity: id,
onItem: function(item, request) { console.log(item); }
});
//window.grid.store.deleteItem(id);
}
dojo.ready(function() {
var store = new dojo.data.ItemFileWriteStore({data:{items:[]}});
window.grid = new dojox.grid.DataGrid({
store: store,
structure: [
{ name: "id", field: "id", width: "50px" },
{ name: "Stylist", field: "stylist", width: "100px" },
{ name: "Service", field: "service", width: "200px" },
{ name: "Length", field: "length", width: "50px" },
{ name: "Remove", field: "remove", width: "30px", formatter: getRemoveFormatter }
],
identifier: "id",
label: "id"});
dojo.byId("services_grid").appendChild(grid.domNode);
grid.startup();
observeAppointmentServiceAddClick(window.grid);
getAppointmentItems();
});
그것을 않았다! 고맙습니다!!!!! –
위대한! 도움이 된 것을 기쁘게 생각합니다! –