Can you use THIS to reference an Editor's instance name?
Can you use THIS to reference an Editor's instance name?
A lot of the times, when I'm inside of an Editor instance, I need to get or set content within that instance.
Is there a way to get the name of the instance you are in? AND/OR, is there a way to reference the name of the instance when performing other tasks?
Like, in this pusedo-code:
dteSchedules = new $.fn.dataTable.Editor({
//stuff to configure editor
}).dependent('FieldA', function(val) {
dteSchedules.field('FieldB').val('set a value');
// can "THIS" be used to reference this instance of dteSchedules?
// "this", as in, this Editor instance's name
this.field('FieldB').val('set a value')
});
This question has accepted answers - jump to:
This discussion has been closed.
Answers
Good point - currently no you can't, but that is something I think it should do and I'll have that in for 1.9.1. If you want to make the change locally, search for this line:
and replace with:
That will let you use
this
inside thedependent()
callback to access the Editor instance in question.Allan
To confirm - this has now been committed in for 1.9.1 .
Allan