FSN#36083 Tijdens/na SCF modal onderliggende record highlighten

svn path=/Website/trunk/; revision=28932
This commit is contained in:
Jos Groot Lipman
2016-04-13 19:45:18 +00:00
parent 19c02ed9b0
commit ffb2ad0547
8 changed files with 66 additions and 10 deletions

View File

@@ -18,13 +18,20 @@ var FcltMgr =
{ {
_pageManager: null, // defaultManager of tabbedManager _pageManager: null, // defaultManager of tabbedManager
globalData: [], globalData: [],
reload: function () reload: function (appendurl)
{ // met (door jquery tabs toegevoegd) fragment identifier werkt onderstaand anders niet { // met (door jquery tabs toegevoegd) fragment identifier werkt onderstaande anders niet
var hrefBase = window.location.href.split( "#" )[ 0 ]; var hrefBase = window.location.href.split( "#" )[ 0 ];
// nooit collapsed herladen? // nooit collapsed herladen?
hrefBase = hrefBase.replace(/&collapsed=1/gi, ""); hrefBase = hrefBase.replace(/&collapsed=1/gi, "");
if (hrefBase.indexOf("no_autoscroll") == -1) if (hrefBase.indexOf("no_autoscroll") == -1)
hrefBase = hrefBase + (hrefBase.indexOf("?")>0?"&":"?") + "no_autoscroll=1"; hrefBase = hrefBase + (hrefBase.indexOf("?")>0?"&":"?") + "no_autoscroll=1";
if (appendurl)
{
var nm = appendurl.split("=")[0];
if (hrefBase.indexOf("&" + nm + "=") > 0)
hrefBase = hrefBase.substr(0, hrefBase.indexOf("&" + nm + "="));
hrefBase += "&" + appendurl;
}
window.location.href = hrefBase; window.location.href = hrefBase;
}, },
defaultManager : defaultManager :

View File

@@ -119,7 +119,7 @@ for (var i = 0; i < disc_arr_key.length; i++)
} }
} }
} }
var result = {success: true }; var result = {success: true, key: disc_arr_key.join(",") };
Response.Write(JSON.stringify(result)); Response.Write(JSON.stringify(result));
Response.End; Response.End;

View File

@@ -3,6 +3,11 @@
$Id$ $Id$
*/ */
function scf_reload (json, b, c)
{
FcltMgr.reload("scf_highlight=" + json.key);
}
function edit_rechten(row) function edit_rechten(row)
{ {
var functie_key = row.getAttribute("ROWKEY"); var functie_key = row.getAttribute("ROWKEY");
@@ -16,7 +21,7 @@ function edit_rechten(row)
else if (window.groep_key > 0) else if (window.groep_key > 0)
{ {
var url = "fac_edit_groeprechten.asp?fac_groep={0}&fac_functie={1}".format(window.groep_key, functie_key); var url = "fac_edit_groeprechten.asp?fac_groep={0}&fac_functie={1}".format(window.groep_key, functie_key);
FcltMgr.openModalDetail(url, L("fac_groeprechten"), { callback: FcltCallbackRefresh }); FcltMgr.openModalDetail(url, L("fac_groeprechten"), { callback: scf_reload });
} }
else // eerst nog een groep erbij kiezen else // eerst nog een groep erbij kiezen
{ {

View File

@@ -3,6 +3,11 @@
$Id$ $Id$
*/ */
function scf_reload (json, b, c)
{
FcltMgr.reload("scf_highlight=" + json.key);
}
function edit_rechten(row) function edit_rechten(row)
{ {
var groep_key = row.getAttribute("ROWKEY"); var groep_key = row.getAttribute("ROWKEY");
@@ -16,7 +21,7 @@ function edit_rechten(row)
else if (window.functie_key > 0) else if (window.functie_key > 0)
{ {
var url = "fac_edit_groeprechten.asp?fac_groep={0}&fac_functie={1}&ins_discipline={2}".format(groep_key, window.functie_key, window.disc_key); var url = "fac_edit_groeprechten.asp?fac_groep={0}&fac_functie={1}&ins_discipline={2}".format(groep_key, window.functie_key, window.disc_key);
FcltMgr.openModalDetail(url, L("fac_groeprechten"), { callback: FcltCallbackRefresh }); FcltMgr.openModalDetail(url, L("fac_groeprechten"), { callback: scf_reload });
} }
else // eerst nog een functie erbij kiezen else // eerst nog een functie erbij kiezen
{ {

View File

@@ -3,6 +3,11 @@
$Id$ $Id$
*/ */
function scf_reload (json, b, c)
{
FcltMgr.reload("scf_highlight=" + json.key);
}
function edit_rechten(row) function edit_rechten(row)
{ {
if (row instanceof Array) if (row instanceof Array)
@@ -13,7 +18,7 @@ function edit_rechten(row)
if (window.functie_key > 0 && window.groep_key) if (window.functie_key > 0 && window.groep_key)
{ {
var url = "fac_edit_groeprechten.asp?fac_groep={0}&fac_functie={1}&ins_discipline={2}".format(window.groep_key, window.functie_key, discKeyString||disc_key); var url = "fac_edit_groeprechten.asp?fac_groep={0}&fac_functie={1}&ins_discipline={2}".format(window.groep_key, window.functie_key, discKeyString||disc_key);
FcltMgr.openModalDetail(url, L("fac_groeprechten"), { callback: FcltCallbackRefresh }); FcltMgr.openModalDetail(url, L("fac_groeprechten"), { callback: scf_reload });
} }
else if (window.functie_key > 0) else if (window.functie_key > 0)
{ {

View File

@@ -26,6 +26,8 @@ function scaffolding_delete(model, scf_params)
warning: warning, warning: warning,
success: true success: true
}; };
if (!result.warning)
result.toaster = L("lcl_scf_is_deleted").format(model.record_title);
Response.Write(JSON.stringify(result)); Response.Write(JSON.stringify(result));
} }
%> %>

View File

@@ -70,12 +70,18 @@ function scaffolding_list(model, scf_params)
<head> <head>
<% FCLTHeader.Generate({ outputmode: outputmode }); %> <% FCLTHeader.Generate({ outputmode: outputmode }); %>
<script> <script>
function scf_reload (json)
{
FcltMgr.reload("scf_highlight=" + json.key);
}
function scf_show(row) function scf_show(row)
{ {
var key = row.getAttribute("ROWKEY"); var key = row.getAttribute("ROWKEY");
var url = "<%= default_url %>".format(key); var url = "<%= default_url %>".format(key);
<% if (modal) { %> <% if (modal) { %>
FcltMgr.openModalDetail(url, "<%=safe.jsstring(model.record_title)%>", { callback: FcltMgr.reload }); $("#<%=model.table%> tbody tr").removeClass("updated")
$(row).addClass('updated');
FcltMgr.openModalDetail(url, "<%=safe.jsstring(model.record_title)%>", { callback: scf_reload });
<% } else { %> <% } else { %>
$(row).addClass('dirty'); $(row).addClass('dirty');
FcltMgr.openDetail(url, "<%=safe.jsstring(model.record_title)%>"); FcltMgr.openDetail(url, "<%=safe.jsstring(model.record_title)%>");
@@ -87,7 +93,7 @@ function scaffolding_list(model, scf_params)
<% <%
if (modal) { if (modal) {
%> %>
FcltMgr.openModalDetail("<%= scf_params.this_fullpath + "?mode=edit" + transit %>", "<%=L("lcl_add") + " " + safe.jsstring(model.record_title)%>", { callback: FcltMgr.reload }); FcltMgr.openModalDetail("<%= scf_params.this_fullpath + "?mode=edit" + transit %>", "<%=L("lcl_add") + " " + safe.jsstring(model.record_title)%>", { callback: scf_reload });
<% } else { %> <% } else { %>
FcltMgr.openDetail("<%= scf_params.this_path + "?mode=wrap" + transit %>", "<%=L("lcl_add") + " " + safe.jsstring(model.record_title)%>"); FcltMgr.openDetail("<%= scf_params.this_path + "?mode=wrap" + transit %>", "<%=L("lcl_add") + " " + safe.jsstring(model.record_title)%>");
<% } %> <% } %>
@@ -175,6 +181,30 @@ function scaffolding_list(model, scf_params)
var xxx_array = model.REST_GET(xxx_params); var xxx_array = model.REST_GET(xxx_params);
} }
var highlight = filter.scf_highlight;
if (typeof highlight == "string")
highlight = highlight.split(",");
function fnRowClass(oRs)
{
if (!highlight)
return null;
var key = oRs.Fields("id").Value;
if (inArray(key, highlight))
return "updated";
return null;
}
function fnRowChecked(oRs)
{
if (!highlight || highlight.length <= 1)
return false;
var key = oRs.Fields("id").Value;
if (inArray(key, highlight))
return true;
return false;
}
var rst = new ResultsetTable({ dataset: xxx_array, var rst = new ResultsetTable({ dataset: xxx_array,
hasMore: model.total_count > xxx_array.length, hasMore: model.total_count > xxx_array.length,
keyColumn: ("id" in model.fields?"id":null), keyColumn: ("id" in model.fields?"id":null),
@@ -182,7 +212,8 @@ function scaffolding_list(model, scf_params)
title: model.records_title, title: model.records_title,
showAll: showAll, showAll: showAll,
canCSV: !nobuttons && model.list.canCSV, canCSV: !nobuttons && model.list.canCSV,
rowClass: model.list.rowClass, rowClass: model.list.rowClass || fnRowClass,
rowChecked: fnRowChecked,
rowData: scf_params.list.fnRowData, rowData: scf_params.list.fnRowData,
outputmode: outputmode, outputmode: outputmode,
noPrint: nobuttons, noPrint: nobuttons,

View File

@@ -1179,7 +1179,8 @@ function __rsMakeTableRow(oRs, oRsFlexData, cnt, anyMultiActions, noFlexResult)
// ========= COLUMNS ========= // ========= COLUMNS =========
if (!isPrinting && !isExcel && anyMultiActions && !inline) // Checkboxje erbij voor 'select all' if (!isPrinting && !isExcel && anyMultiActions && !inline) // Checkboxje erbij voor 'select all'
{ {
appender += "<td><input type=checkbox class='multiselect'></td>"; var isChecked = this.rowChecked && this.rowChecked(oRs, this.processParams);
appender += "<td><input type=checkbox class='multiselect'" + (isChecked?' checked=1':'') + "></td>";
} }
if (!isPrinting && !isExcel && inlineDetails) if (!isPrinting && !isExcel && inlineDetails)
{ {