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": { "query": {
"name": "Query callback", "name": "Query callback",
"type": "any", "type": "js",
"default": false, "default": et2_no_init,
"description": "Callback before query to server. Must return true, or false to abort query." "description": "Callback before query to server. Must return true, or false to abort query."
}, },
"select": { "select": {
"name": "Select callback", "name": "Select callback",
"type": "any", "type": "js",
"default": false, "default": et2_no_init,
"description": "Callback when user selects an option. Must return true, or false to abort normal action." "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 * Ask server for entries matching selected app/type and filtered by search string
* *