diff --git a/EuroTran/WebApp/Scripts/pages/ShowEasy/ONSiteMaintain_Upd.js b/EuroTran/WebApp/Scripts/pages/ShowEasy/ONSiteMaintain_Upd.js
index cf49dbc..ca32dda 100644
--- a/EuroTran/WebApp/Scripts/pages/ShowEasy/ONSiteMaintain_Upd.js
+++ b/EuroTran/WebApp/Scripts/pages/ShowEasy/ONSiteMaintain_Upd.js
@@ -10,6 +10,7 @@ var saRegionList = [];
var copyFlag = null;
var oTWCity = [];
var oTruck = [];
+var selExhibition = [];
var fnPageInit = function () {
var sLang = g_ul.GetLang(),
canDo = new CanDo({
@@ -443,6 +444,27 @@ var fnPageInit = function () {
});
+ //綁定展會查詢事件部分
+ $('#btnQryExhibition').unbind('click').click(function () {
+ $("#MainCategoryIDPop").val("");
+ $("#SubCategoryIDPop").val(""),
+ $("#ExhibitionNamePop").val(""),
+ selExhibition = [];
+ $.whenArray([fnGetExhibitionList()]).done(function (res) {
+ //把需要的選上
+ $('#jsExhibitionGrid').find('[type=checkbox]').each(function () {
+ if ($("#ExhibitionID").val().indexOf($(this).attr("ExhibitionID")) > -1) {
+ //this.checked = true;
+ $(this).click();
+ }
+ });
+ $("#jsExhibitionGrid").find('#SelectAll')[0].checked = false;
+ $('#ExhibitionPop').modal('toggle');
+ });
+
+
+ });
+
//基本資訊儲存
$('#btnSaveBasic').click(function () {
if (!$.isEmptyObject(canDo.UE_Editor)) {
@@ -553,7 +575,6 @@ var fnPageInit = function () {
});
$('#jsOrderQuertionGrid [data-input]').on('change click', function () {
- // debugger;
var sId = $(this).attr('data-value') * 1,
sVal = this.value;
@@ -1665,17 +1686,7 @@ var fnPageInit = function () {
$('#btnQrySurvey').unbind('click').click(function () {
fnGetSurveyQustionList();
});
- $('#btnSurveyAllCheck').unbind('click').click(function () {
- $('#jsSurveyQustionGrid').find('[type=checkbox]').each(function () {
- this.checked = true;
- });
- });
- $('#btnSurveyAllClear').unbind('click').click(function () {
- $('#jsSurveyQustionGrid').find('[type=checkbox]:checked').each(function () {
- this.checked = false;
- });
- });
-
+
$("#jsSurveyQustionGrid").jsGrid({
width: "100%",
autoload: true,
@@ -1689,7 +1700,26 @@ var fnPageInit = function () {
},
fields: [
{
- width: 30, sorting: false, align: "center",
+ width: 50, sorting: false, align: "center",
+ headerTemplate: function () {
+ return [$("
", {
+ id: 'SelectAll',
+ type: 'checkbox', click: function () {
+
+ if (this.checked) {
+ $("#jsSurveyQustionGrid").find('[type=checkbox]').each(function () {
+ this.checked = true;
+ });
+
+ }
+ else {
+ $("#jsSurveyQustionGrid").find('[type=checkbox]:checked').each(function () {
+ this.checked = false;
+ });
+ }
+ }
+ }), $('
', { for: 'SelectAll', 'html': '全選' })]
+ },
itemTemplate: function (value, item) {
return $("
", {
type: 'checkbox', click: function (e) {
@@ -1951,12 +1981,14 @@ var fnPageInit = function () {
},
//初始化展覽問題列表的Gird
fnInitExhibitionGrid = function () {
+ var saLastData = [],
+ KeyCol = "ExhibitionID";
//展覽主,子類別綁定
setExhibCategory("MainCategoryIDPop", "Y");
setExhibCategory("SubCategoryIDPop", "N");
- //綁定訂單問題事件部分
- $('#btnQryExhibition').unbind('click').click(function () {
+ //綁定展會查詢事件部分
+ $('#btnQryExhibitionPop').unbind('click').click(function () {
fnGetExhibitionList();
});
@@ -1973,18 +2005,54 @@ var fnPageInit = function () {
},
fields: [
{
- width: 30, sorting: false, align: "center",
+ width: 50, sorting: false, align: "center",
+ headerTemplate: function () {
+ return [$("
", {
+ id: 'SelectAll',
+ type: 'checkbox', click: function () {
+
+ if (this.checked) {
+ $("#jsExhibitionGrid").find('[type=checkbox]').each(function () {
+ this.checked = true;
+ });
+ $.each(saLastData, function (idx, _item) {
+ selExhibition = Jsonremove(selExhibition, KeyCol, _item[KeyCol]);
+ selExhibition.push(_item);
+ });
+ }
+ else {
+ $("#jsExhibitionGrid").find('[type=checkbox]:checked').each(function () {
+ this.checked = false;
+ });
+ $.each(saLastData, function (idx, _item) {
+ selExhibition = Jsonremove(selExhibition, KeyCol, _item[KeyCol]);
+ });
+ }
+ }
+ }), $('
', { for: 'SelectAll', 'html': '全選' })]
+ },
itemTemplate: function (value, item) {
return $("
", {
type: 'checkbox', click: function (e) {
e.stopPropagation();
- },
+ if (this.checked) {
+ selExhibition = Jsonremove(selExhibition, KeyCol, item[KeyCol]);
+ selExhibition.push(item);
+ }
+ else {
+ selExhibition = Jsonremove(selExhibition, KeyCol, item[KeyCol]);
+ $("#jsExhibitionGrid").find('#SelectAll')[0].checked = false;
+ }
+
+ }
+ , checked: Jsonget(selExhibition, KeyCol, item[KeyCol])[0] != undefined // ($("#ExhibitionID").val().indexOf(item.ExhibitionID) > -1 ? true : false)
+ ,
"ExhibitionID": item.ExhibitionID,
"ExhibitionName": item.ExhibitionName
});
}
},
- { name: "ExhibitionNo", title: '展覽號碼', editing: false, align: "left", width: 80 },
+ /*{ name: "ExhibitionNo", title: '展覽號碼', editing: false, align: "left", width: 80 },*/
{ name: "ExhibitionName", title: '展覽名稱', editing: false, align: "left", width: 250 },
{ name: "AbbreviatedName", title: '展覽簡稱', editing: false, align: "left", width: 100 }
],
@@ -1994,6 +2062,7 @@ var fnPageInit = function () {
fnGetExhibitionList(args);
}
else {
+ saLastData = args.PopData.data;
return args.PopData;
}
},
@@ -2009,19 +2078,17 @@ var fnPageInit = function () {
$('#ExhibitionOK').click(function () {
$('#ExhibitionNames').val("");
$('#ExhibitionID').val("");
- if ($('#jsExhibitionGrid').find('[type=checkbox]:checked').length > 0) {
+ if (selExhibition.length > 0) {
var saExhibition = [];
var sExhibition = '';
- $('#jsExhibitionGrid').find('[type=checkbox]:checked').each(function () {
- saExhibition.push($(this).attr("ExhibitionID"));
- sExhibition += $(this).attr("ExhibitionName")+";";
- });
+ selExhibition.forEach(function (item) {
+ saExhibition.push(item.ExhibitionID);
+ sExhibition += item.ExhibitionName + ";";
+ })
$('#ExhibitionNames').val(sExhibition);
$("#ExhibitionNames").attr("title", sExhibition);
$('#ExhibitionID').val(JSON.stringify(saExhibition));
};
-
-
});
},