You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

77 lines
3.4 KiB

'use strict';
var fnPageInit = function () {
var canDo = new CanDo({
/**
* 當前程式所有ID名稱集合
*/
idKeys: ['OrgID', 'ThemeID', 'Language'],
//*
// * Grid欄位設置(可以是 function)
gridFields: [
{ name: "RowIndex", title: 'common.RowNumber', align: 'center', width: 50, sorting: false, align: 'center' },
//{ name: "ThemeID", title: 'ThemeMaintain_Qry.ThemeID', width: 150, align: 'center' },
{ name: "Title", title: 'ThemeMaintain_Qry.Title', width: 150, align: 'center' },
{
name: "Image", title: 'ThemeMaintain_Qry.Image', width: 150, align: 'center', itemTemplate: function (val, item) {
return '<img src='+"../../"+item.FilePath+' style="vertical-align:center;max-height:60px;max-width:100%;" />';
} },
{
name: "Link", title: 'ThemeMaintain_Qry.Link', width: 150, align: 'center', itemTemplate: function (val, item) {
return item.FilePath;
} },
{
name: "Effective", title: 'common.Status', width: 200, align: 'center', itemTemplate: function (val) {
return val === 'Y' ? i18next.t('common.Enable') : i18next.t('common.Disable');
}
},
{
name: "OrderByValue", title: 'common.OrderByValue', type: "select", width: 150, align: 'center',
itemTemplate: function (val, item) {
return this._createSelect = $("<select>", {
class: 'w70',
html: createOptions(item.OrderCount),
change: function () {
var sOldValue = val,
sNewValue = this.value;
g_api.ConnectLite(canDo.ProgramId, "UpdateOrderByValue", {
ThemeID: item.ThemeID,
Language: item.Language,
OldOrderByValue: sOldValue,
NewOrderByValue: sNewValue
}, function (res) {
if (res.RESULT) {
showMsg(i18next.t('message.Update_Success'), 'success');// ╠message.Update_Success⇒更新成功╣
canDo.Grid.openPage(canDo.options.toFirstPage ? 1 : canDo.options.queryPageidx);
}
else {
showMsg(i18next.t('message.Update_Failed') + '<br>' + res.MSG, 'error'); // ╠message.Update_Failed⇒更新失敗╣
}
});
}
}).val(val);
}
}
],
/**
* 頁面初始化
* @param {Object} pargs CanDo 對象
*/
pageInit: function (pargs) {
var postArray = [];
postArray.push();
$.whenArray(postArray).done(function () {
pargs._reSetQueryPm();
pargs._initGrid();
});
}
})
};
require(['base', 'jsgrid', 'cando'], fnPageInit);