EasyUI
Home
Demo
Tutorial
Documentation
Download
Extension
Contact
Forum
EasyUI Forum
April 25, 2024, 11:43:57 PM
Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News
:
Home
Help
Search
Login
Register
EasyUI Forum
>
General Category
>
EasyUI for jQuery
>
[SOLVED] Datagrid filter - Focus
Pages: [
1
]
« previous
next »
Print
Author
Topic: [SOLVED] Datagrid filter - Focus (Read 3918 times)
jega
Full Member
Posts: 190
[SOLVED] Datagrid filter - Focus
«
on:
June 11, 2018, 12:47:36 AM »
Hi.
Have a strange problem, that i can't see why.
Sample:
Datagrid with 2 columns, 1 = userID, 2 = personName
dg.datagrid('enableFilter',[
{
field:'personName',
type:'textbox',
op:['contains','equal'],
defaultFilterOperator: getCookie("personSearch - personName - filterOperator")
}
]);
After that, i use $( "input.datagrid-filter[name='userID]" ).focus(); and it works
But when i do $( "input.datagrid-filter[name='personName]" ).focus(); there is no focus
Removing
{
field:'personName',
type:'textbox',
op:['contains','equal'],
defaultFilterOperator: getCookie("personSearch - personName - filterOperator")
}
from enableFilter, it works with $( "input.datagrid-filter[name='personName]" ).focus();
«
Last Edit: June 11, 2018, 02:13:11 AM by jega
»
Logged
stworthy
Administrator
Hero Member
Posts: 3581
Re: Datagrid filter - Focus
«
Reply #1 on:
June 11, 2018, 01:39:20 AM »
Call 'getFilterComponent' method to get the filter component and then focus on it.
Code:
var tb = $('#dg').datagrid('getFilterComponent','personName');
tb.textbox('textbox').focus();
Logged
jega
Full Member
Posts: 190
Re: Datagrid filter - Focus
«
Reply #2 on:
June 11, 2018, 02:12:53 AM »
Hi stworthy
Thanks. Works as expected.
Logged
Pages: [
1
]
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
General Category
-----------------------------
=> News
=> General Discussion
=> EasyUI for jQuery
=> EasyUI for Angular
=> EasyUI for Vue
=> EasyUI for React
=> Bug Report
Loading...