결과가 도조 1.6 데이터 격자를 통해 표시되는 검색 양식을 구현하려고합니다. 나는 렌더링 작업을하고, 폼에서 ajax 호출을 호출 한 다음 ItemFileWriteStore를 사용하여 콜백 함수에서 Datagrid를 빌드합니다. 내가 그리드를 편집하고 서버에 변경 내용을 유지하려고 할 때검색 폼과 편집 가능한 DataGrid와 함께 JsonRestStore를 사용하는 방법
function search()
{
var action = './search.json';
dojo.xhrPost({url: action, form:"searchForm",
load: function(result) {
var newStore = new dojo.data.ItemFileWriteStore({
data: {
identifier: "id",
items: JSON.parse(result),
url:'./search.json'
}
});
var grid = dijit.byId("searchResultsGrid");
if(grid == null) {
var layout = [[
{'name': 'Id', 'field': 'id', 'width': '50px'},
{'name': 'Name', 'field': 'name', 'width': '50px',editable: true,},
{'name': 'Source', 'field': 'source', 'width': '50px',editable: true,},
{'name': 'Version', 'field': 'version', 'width': '50px',editable: true,}
]];
var grid = new dojox.grid.DataGrid({
id: 'searchResultsGrid',
store: newStore,
structure: layout,
autoHeight:true, autoWidth:true, editable:true, columnReordering:true,
rowSelector: '20px'
});
grid.placeAt("gridDiv");
grid.startup();
}
else {
grid.setStore(newStore);
}
}
});
}
지금, 아무것도 ItemFileWriteStore으로 발생하지 않습니다. 따라서 JsonRestStore로 전환하여 계속 유지하려고합니다.
하지만 질문은, 내 양식을 JsonRestStore에 연결하는 방법 또는 다른 말로하면 동적 쿼리를 JsonRestStore에 전달하는 방법이 있습니까? JsonRestStore에서 검색 양식을 제출할 때 데이터를 가져오고 검색 양식의 값을 기반으로합니다.
미리 감사드립니다.