Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82226

split button wrapper div doesn't get the class assigned

$
0
0

I have this split button:

ctrTable.button().add( 3, {   
    extend: "editPSCData", className: "editorOnly", name: "editPSCVatDataButton",
    split: [
        {   extend: "editPSCData", name: "editPSCPreTaxDataButton",
            text: lang === 'de' ? 'VSt.-Check §15 UStG' : 'Input tax check §15 UStG'},
        {   extend: "editPSCData", name: "editPSCPreTaxCorrectionButton", className: "hidden",
            text: lang === 'de' ? 'VSt.-Korrektur §15a UStG' : 'Input tax adjustmt. §15a UStG'}
    ]
} );

When I ran this code:

if ( ! isCtrEditor ) {
    ctrTable.buttons('.editorOnly').nodes().addClass('hidden'); 
}

which means, if the user is not entitled to edit a contract the "editorOnly" buttons should be hidden.

That didn't work for the split button. While the two buttons in the dropdown of the split button were hidden the wrapper div containing the first or "main" button was not hidden because the class "editorOnly" wasn't assigned to the wrapper div by Data Tables.

I added this workaround to make it work:

$('div.dt-btn-split-wrapper > button.editorOnly').parent().addClass("editorOnly");

I think this is a bug.


Viewing all articles
Browse latest Browse all 82226

Trending Articles