Use js type for query & select callbacks and implement setter functions

This commit is contained in:
Nathan Gray 2014-06-09 19:28:31 +00:00
parent fa8963c8b4
commit a9e37042cb

View File

@ -512,14 +512,14 @@ var et2_link_entry = et2_inputWidget.extend(
},
"query": {
"name": "Query callback",
"type": "any",
"default": false,
"type": "js",
"default": et2_no_init,
"description": "Callback before query to server. Must return true, or false to abort query."
},
"select": {
"name": "Select callback",
"type": "any",
"default": false,
"type": "js",
"default": et2_no_init,
"description": "Callback when user selects an option. Must return true, or false to abort normal action."
}
},
@ -856,6 +856,26 @@ var et2_link_entry = et2_inputWidget.extend(
}
},
/**
* Set the query callback
*
* @param {function} query
*/
set_query: function(f)
{
this.options.query = f;
},
/**
* Set the select callback
*
* @param {function} query
*/
set_select: function(f)
{
this.options.select = f;
},
/**
* Ask server for entries matching selected app/type and filtered by search string
*