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

Changing aspects of fields for edit vs new

$
0
0
So I'm trying to have a certain field be available for input on a ADD, but have that same field be readonly for an edit. (I'll figure out how to populate it later....)
I'm trying to do it this way, but it's not working the way I intend it. Strangely enough, it always seems to be readonly, even on the first console.log, so I'm kind of confused (even though the field is only readonly if I set it as such in the fields/type section of the init object.


editor.on('onInitEdit',function(e)
{
console.log (e.target.s.fields[0]);
e.target.s.fields[0].type ="readonly";
console.log (e.target.s.fields[0]);
});

Viewing all articles
Browse latest Browse all 82145

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>