Editor readonly field not works
Editor readonly field not works

Hi,
I tried to set a field as readonly, but it's not working.
It's still editable. And I use Editor with inline mode.
See snip of code as below:
editor = new $.fn.dataTable.Editor({
fields: [
{
type: "readonly",
label: "product.productNumber:",
name: "product.productNumber",
});
dataTable = $('#grid').DataTable({
"dom": "Bfrtip",
"columns": [
{ "data": "product.productNumber" }
]
});
Thank you,
Allen Tsai
This discussion has been closed.
Answers
Hi @allenstyle ,
This is working as expected for me here. The inline activates but editing isn't permitted - to prevent inline, you can change the selector to be
Hope that helps. If not, please could you modify that test case to demonstrate your issue.
Cheers,
Colin
Hi Colin,
Thank you for you reply!
I saw your sample code, it worked very well.
In fact, I want two fields not to fire edit mode while clicking on them.
Could you give me tips for this?
Thank you,
Allen Tsai
You would use the nth-child selector, for example:
Kevin