Commit d9ed1b47 authored by 覃振观's avatar 覃振观 👶

23-12-16: 下班前提交

parent 08074efd
...@@ -26,19 +26,25 @@ function initializeUI() { ...@@ -26,19 +26,25 @@ function initializeUI() {
}); });
} }
function deleteHandler(){
DataUtil.del({
gridManager:gridManager,idFieldName:'id',
onSuccess:function(){
}
});
}
function faceGrid(elId, data) { function faceGrid(elId, data) {
var toolbarOptions = UICtrl.getDefaultToolbarOptions({ var toolbarOptions = UICtrl.getDefaultToolbarOptions({
addHandler: function(){ addHandler: function(){
UICtrl.addGridRow(gridManager);
}, },
updateHandler: function(){ updateHandler: function(){
updateHandler(); updateHandler();
}, },
aaHandler: { id: 'ccAA', text: 'Hello', img: 'fa-music', className: 'btn-gray', deleteHandler: () => {
click: function () { gridManager.deleteSelectedRow();
alert('hello~!'); },
}
}
}); });
var gridManager = listeningGrid(elId, { var gridManager = listeningGrid(elId, {
columns: [ columns: [
...@@ -46,9 +52,7 @@ function faceGrid(elId, data) { ...@@ -46,9 +52,7 @@ function faceGrid(elId, data) {
type: 'text', type: 'text',
required: true required: true
}}, }},
{ display: "油墨覆盖率(%)", name: "coverageRate", width: 120, minWidth: 60, type: "string", align: "left", editor: { type: 'text', required: true } }, { display: "油墨覆盖率(%)", name: "coverageRate", width: 120, minWidth: 60, type: "string", align: "left", editor: { type: 'text', required: true } }
{ name: "colorId", hide: true },
{ name: "colorId" }
], ],
toolbar: toolbarOptions, toolbar: toolbarOptions,
dataType: "local", dataType: "local",
...@@ -107,13 +111,10 @@ function loadDataTest() { ...@@ -107,13 +111,10 @@ function loadDataTest() {
data: params.get("data") data: params.get("data")
}, function (data) { }, function (data) {
var showData = mapping(dataMapping, data.rawData); var showData = mapping(dataMapping, data.rawData);
debugger;
$('#submitForm').formSet(showData); $('#submitForm').formSet(showData);
var fronData = {}; var fronData = {};
fronData.Rows = data.rawData.fronColors; faceGrid("#fronColorsGrid", data.rawData.fronColors);
faceGrid("#fronColorsGrid", fronData); faceGrid("#backColorsGrid", data.rawData.backColors);
fronData.Rows = data.backColors;
faceGrid("#backColorsGrid", fronData);
inputEventListener(); inputEventListener();
}); });
} }
...@@ -122,8 +123,6 @@ function loadDataTest() { ...@@ -122,8 +123,6 @@ function loadDataTest() {
// alias必须唯一.这里不再要求所有对象的属性名唯一 { property : alias } // alias必须唯一.这里不再要求所有对象的属性名唯一 { property : alias }
// 未设 alias 情况同 { property : property } // 未设 alias 情况同 { property : property }
// Grid: 需要监听 Grid Data 时,必须设置 唯一 id 列。 // Grid: 需要监听 Grid Data 时,必须设置 唯一 id 列。
// 匹配规则 elementId.indexOf( dataMapping.ArrayKey )
// 即当前页面 ‘fronColorsGrid’.indexOf('fronColors')
var dataMapping = { var dataMapping = {
Product: [ Product: [
"productId" "productId"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment