0
안녕하세요, Yahoo lib-grid를 연구하려고합니다. 그리드를 표시하는 단추를 만들었습니다. 하지만 버튼을 N 번 클릭하면 N 개의 그리드로 표시됩니다. 난 단지 하나의 그리드를 표시하고 버튼을 클릭 한 후 다시 서버에서 데이터를 얻을 것이다 싶어요. 내 코드는 아래와 같습니다 : 도와주세요., 고마워요.YUI-grid : 데이터로드
YUI({ filter: 'raw' }).use("jsonp", "node",function (Y) {
function handleJSONP(response) {
// Y.one("#out").setContent(Y.Lang.sub(template, response.user));
YUI().use("datatable-base", function(Y) {
var cols = [
{ key: "id", label: "Transaction No", abbr: "id"},
{ key: "userName", label: "User Name", abbr: "userName"},
{ key: "storeName", label: "StoreName", abbr: "storeName"}
],
data = response.Root,
dt = new Y.DataTable.Base({
columnset: cols,
recordset: data,
summary: "Price sheet for inventory parts",
caption: "These columns have labels and abbrs"
}).render("#example");
});
}
Y.one("#demo_btn").on("click", function (e) {
var url = "server.jsp"+ "?callback={callback}";
Y.jsonp(url, handleJSONP);
});
});