Disable/Enable New/Delete buttons based on user permissions/interaction
Disable/Enable New/Delete buttons based on user permissions/interaction
agustin_garciaromero
Posts: 42Questions: 0Answers: 0
Hello,
I'd like to enable/disable the Editor's New/Delete buttons based on user interaction and permissions (e.g.: if user has certain access level he can add or delete records from DataTable)
Is there any example out there?
Regards
I'd like to enable/disable the Editor's New/Delete buttons based on user interaction and permissions (e.g.: if user has certain access level he can add or delete records from DataTable)
Is there any example out there?
Regards
This discussion has been closed.
Replies
[code]
"fnSelect": function( nButton, oConfig ) {
if ( this.fnGetSelected().length !== 0 ) {
$(nButton).removeClass( this.classes.buttons.disabled );
} else {
$(nButton).addClass( this.classes.buttons.disabled );
}
},
[/code]
You could do something similar.
However, I think TableTools should provide enable and disable methods for button control. I will look at adding this - hopefully today, but its already shaping p to be a busy day! I'll post back when it is committed.
Allan
Were you able to look into this? Do you think it's something that can be added in future releases?
Regards
Thinking about it, TableTools doesn't actually have any way of addressing buttons which are on the page (they don't have a "name" for example), so actually this might not be quite as trivial as I had thought. However, I think this is an important ability to have, and it will certainly be going into v3 of TableTools, if I can't figure out a way of shoe horning it into the current v2 series.
Allan