properties for new types IMG VIDEO AUDIO
properties for new types IMG VIDEO AUDIO

Dear Allan,
Continuing the topic
https://datatables.net/forums/discussion/66776
put the question in a separate thread.
There is such a convenient dependent mechanism
editor_quest.dependent( 'quest_enable_img', function ( val ) {
return val == 0?
{ hide: ['quest_img'] } :
{ show: ['quest_img'] };
} );
I would like to use it for my new img video audio object types.
Where can I see how this is done correctly for typical objects?
get: function ( conf ) {
return $('button.selected', conf._input).attr('value');
},
set: function ( conf, val ) {
$('button.selected', conf._input).removeClass( 'selected' );
$('button.inputButton[value='+val+']', conf._input).addClass('selected');
},
enable: function ( conf ) {
conf._enabled = true;
$(conf._input).removeClass( 'disabled' );
},
disable: function ( conf ) {
conf._enabled = false;
$(conf._input).addClass( 'disabled' );
}
Thanks!
With respect,
Andrey
This question has accepted answers - jump to:
This discussion has been closed.
Answers
There are a few examples scattered around the forum, such as this one here (which counts the number of characters typed in the name field), and this one here which sets the salary if an office is "XXX".
I hope that gets you going, if not, can you be more specific about what you're trying to achieve,
Colin
Good day,
Colin,
Thank you for quick answer. Of course, he is useful to me, but I would like to clarify a number of points that I could not find on the forum.
In the above example, there is the format property.
live.datatables.net/wefidiqe/1/edit
First question:
Can you see how the FORMAT property for TYPE: 'datetime' is formed at the module level for determining the datetime field type?
Can I change the type of the field on the fly via editor.dependent? How can I do that? It will be rendered with a new property. Alternatively, I want to use type = text and type = textarea.
I really hope for an answer. Thanks!
With respect,
Andrey
the
format
property fordatetime
only needs to be set if you want to change the date format - this example here may help.You can't change the field type as such, but you can remove the field and re-add it again with the new type, and that can be done in the
dependent()
function. This example here from this thread is doing something similar (though in an event rather thatdependent()
),Colin
Colin,
Thanks a lot for your answer. Answer number 2 is what you need.
Thank you!
With respect,
Andrey