Using v5.1.0
Trying to implement a search input for a table, fetched from the database.
The input box is a field control, when you type 3 or more characters the table is fetched with the criteria you wrote. Achieved like this:
- to the "html element properties" of the input field control, put a jquery event of keyup, in the code checking the length of the characters typed, if > 2 the serverside function called, the typed characters passed as parameter.
- serverside function is using the parameter string to set the field control's value, setting the where clause of the db resource and fetching the table with the new where clause.
up to this point it is working, but when the new table data fetched, the cursor in the input field is put to the beginning. Tried to put it to the end of the characters typed, by jquery code, after calling the serverside function but no luck ! Always the cursor is put to the beginning.
Here is the client jquery code:
Code: Select all
if ($(this).val().length >2) {
$eb.executeFunction("searchContactFunction",$(this).val(),true);
}
Code: Select all
function searchContactFunction (srcStr) {
fields.searchFieldInput.value = srcStr;
fields.whereClause.value = "'%" + srcStr + "%'";
tables.contactsList_table.fetchTable();
}
Any ideas appreciated ?