");
+ if (me.checkBox) {
+ field.push("");
+ field.push("");
+ field.push(" ");
+ field.push(" ");
+ field.push(" ");
+ field.push(" | ");
+ }
+ field.push("");
+ field.push(_key);
+ field.push(" | ");
+ for (var f = 0; f < me.field.length; f++) {
+ var _value = _map.get(me.field[f].name);
+ var _style = "";
+ if (me.field[f].hidden) {
+ _style += "display: none;";
+ }
+ if (typeof me.field[f].align === "string") {
+ _style += "text-align: " + me.field[f].align + ";";
+ }
+ field.push("");
+ if (typeof me.field[f].format === 'function') {
+ field.push(me.field[f].format(_map, _key));
+ } else {
+ field.push(_value);
+ }
+ field.push(" | ");
+ }
+ field.push("
");
+ $("#" + me.table + "_body").append(field.join(""));
+ if (me.checkBox) {
+ $("#" + me.table + "_body_tr_" + _key).bind("click", function () {
+ var par = $(this).parent();
+ var _key = $(this).find("input[type='checkbox']").attr("data-key");
+ var $chb = $("#" + me.table + "_grid_checkbox_" + _key);
+ if ($chb.hasClass('multiple-check')) {
+ if ($chb.is(":checked")) {
+ me.keys.remove(_key);
+ $chb.prop("checked", false);
+ $(this).removeAttr("style");
+ $("#" + me.table + "_chb").prop("checked", false);
+ } else {
+ me.keys.push(_key);
+ $chb.prop("checked", true);
+ $(this).css("background-color", "#f5f5f5");
+ }
+ return;
+ }
+ let checkBoxes = par.find("input[name='" + me.table + "_grid_checkbox']");
+ for (let i = 0; i < checkBoxes.length; i++) {
+ let check_key = $(checkBoxes[i]).attr("data-key");
+ me.keys.remove(check_key);
+ $(checkBoxes[i]).prop("checked", false);
+ $(checkBoxes[i]).closest('tr').removeAttr("style");
+ }
+ $("#" + me.table + "_chb").prop("checked", false);
+ if ($chb.is(":checked")) {
+ // me.keys.remove(_key);
+ // $chb.prop("checked", false);
+ // $(this).removeAttr("style");
+ } else {
+ me.keys = [];
+ me.keys.push(_key);
+ $chb.prop("checked", true);
+ $(this).css("background-color", "#f5f5f5");
+ }
+ });
+ $('.cover-checkbox').on('mouseover', function () {
+ $(this).find("input[type='checkbox']").addClass("multiple-check");
+ })
+ $('.cover-checkbox').on('mouseout', function () {
+ $(this).find("input[type='checkbox']").removeClass("multiple-check");
+ })
+ }
+
+ }
+}());
\ No newline at end of file