This project has moved. For the latest updates, please go here.

Removing icons

Aug 3, 2016 at 10:31 AM
Please, may I ask how I could edit the code to remove the filtering icon from each column?
I'm also interested in removing the 'undo' icons as well - depending on the user's context.
Coordinator
Aug 3, 2016 at 12:17 PM
Hi,

File name: dcrmeditabletablegrid.js
Webresource name: dcrmeg_dcrmeg

To hide the filters:

1) Find "CreateAndPopulateGrid" function
2) In the function comment out the following lines:
        var filterclass = 'recfilter';
        if (filterIndexes.ExactMatchExists(headerIndex)) {
            filterclass += ' recfilterset';
        } else {
            filterclass += ' recfilternotset';
        }

        var $recFilter = $('<span></span>')
            .attr(_thisGlobals.ToolTipAttrName, "Filter")
            .attr('id', _thisHelpers.GenerateUUID())
            .addClass(filterclass)
            .appendTo($theader);
Undo Toolbar buttons:

1) Find "CreateGridContainers" function
2) In the function look for the following:
    containerIds.UndoChanges = _thisHelpers.GenerateUUID();
    $tmpBtn = $('<button></button>')
        .attr('id', containerIds.UndoChanges)
        .attr(_thisGlobals.ToolTipAttrName, _thisGlobals.Translation_Labels.UndoChanges)
        .addClass('ToolarButton ToolbarUndo')
        .appendTo($gridToolbar);

    if ((_thisGlobals.FormIsReadOnly) || (!userPrivilages.CanUpdate)) {
        $tmpBtn.hide();
    }

    containerIds.CancelAllChanges = _thisHelpers.GenerateUUID();
    $tmpBtn = $('<button></button>')
        .attr('id', containerIds.CancelAllChanges)
        .attr(_thisGlobals.ToolTipAttrName, _thisGlobals.Translation_Labels.UndoAllChanges)
        .addClass('ToolarButton ToolbarUndoAll')
        .appendTo($gridToolbar);

    if ((_thisGlobals.FormIsReadOnly) || (!userPrivilages.CanUpdate)) {
        $tmpBtn.hide();
    }
3) Add your condition and use JQuery hide():
    containerIds.UndoChanges = _thisHelpers.GenerateUUID();
    $tmpBtn = $('<button></button>')
        .attr('id', containerIds.UndoChanges)
        .attr(_thisGlobals.ToolTipAttrName, _thisGlobals.Translation_Labels.UndoChanges)
        .addClass('ToolarButton ToolbarUndo')
        .appendTo($gridToolbar);
   if(SOMECONDITION) {
       $tmpBtn.hide();
   }
    if ((_thisGlobals.FormIsReadOnly) || (!userPrivilages.CanUpdate)) {
        $tmpBtn.hide();
    }

    containerIds.CancelAllChanges = _thisHelpers.GenerateUUID();
    $tmpBtn = $('<button></button>')
        .attr('id', containerIds.CancelAllChanges)
        .attr(_thisGlobals.ToolTipAttrName, _thisGlobals.Translation_Labels.UndoAllChanges)
        .addClass('ToolarButton ToolbarUndoAll')
        .appendTo($gridToolbar);
   if(SOMECONDITION) {
       $tmpBtn.hide();
   }
    if ((_thisGlobals.FormIsReadOnly) || (!userPrivilages.CanUpdate)) {
        $tmpBtn.hide();
    }
Thank you,
MH
Aug 3, 2016 at 1:34 PM
Great!

Thank you.