MVC / UIBootgrid - add support for title property on custom commands (used in tooltips)

This commit is contained in:
Ad Schellevis 2022-11-21 16:36:56 +01:00
parent 49f63e8082
commit a37303a46c

View File

@ -155,6 +155,7 @@ $.fn.UIBootgrid = function (params) {
let rowid = params.datakey !== undefined ? params.datakey : 'uuid';
commandlist.map(function(command){
let has_option = command.classname !== undefined;
let option_title_str = command.title !== undefined ? " title=\""+command.title+"\"" : "";
for (let i=0; i < command.requires.length; i++) {
if (!(command.requires[i] in params)) {
has_option = false;
@ -162,7 +163,8 @@ $.fn.UIBootgrid = function (params) {
}
if (has_option) {
html.push("<button type=\"button\" class=\"btn btn-xs btn-default bootgrid-tooltip command-"+command.name+
html.push("<button type=\"button\" " + option_title_str +
" class=\"btn btn-xs btn-default bootgrid-tooltip command-"+command.name+
"\" data-row-id=\"" + row[rowid] + "\">"+
"<span class=\""+command.classname+"\"></span></button> "
);