Two Datatables on one form

I have two different datatables on one form. On the first datatable I want to user to be able to delete items only (not add). On the second datatable do not want the user to be able to add or delete. The only way I have seen to manipulate datatables is in CSS editor. Is there a way to do this in the JS editor?

Checking to see if this is this possible?

Hello @cwalter2,

I'm sorry, I've missed your post.

You can hide 'Add new record' button and delete column of the specific control dynamically using jQuery:

var dt = $(fd.control('DataTable1').$el);
//hides 'Add new record' button  
dt.find('.fd-datatable div.k-header.k-grid-toolbar').css('display', 'none')
//hides delete column
dt.find('.fd-datatable table tr th:last-child,.fd-datatable table tr td:last-child').css('display', 'none')
1 Like

I am unable to hide the delete column with this code.

@cwalter2,

Please define fd and $ globally in the JavaScript editor like this:

window.fd = fd;
window.$ = $;

image

And run the code in th console:

$(fd.control('DataTable1').$el).find('.fd-datatable table tr th:last-child,.fd-datatable table tr td:last-child').css('display', 'none')

Are you getting any errors?
Please share the screenshot of the console and the form.