jquery mobile how focus to that item after filtering (searching) it

Multi tool use
up vote
1
down vote
favorite
I am developing an app for tizen tv samsung. it use jquery mobile 1.3.2 my goal is after typing in input and searching an item from listview first item in listview would be focused ( i use jquery.sidebar.min.js to show my listview in that dynamic panel) . please show the code in demo (like jsfidle)
<input id='input' type='text'>
<ol id="listUl" data-role="listview" data-icon="false" style="margin-right: 5px;">
//dynamic list view
document.getElementById('input').addEventListener('change', function() {
$("#input").on('keyup', function(){
var value = $(this).val().toLowerCase();
$("#listUl li").each(function () {
if ($(this).text().toLowerCase().search(value) > -1) {
$(this).show();
$("#listUl").focus();
$(this).prev('.itemListClass').last().show();
} else {
$(this).hide();
}
});
});
// here is how i dynamicly with json parsing add list of item
if (ind === 1) {
return "<li class="itemListClass" id="movieListId" data-theme="b" style="padding-top:25px;padding-left: 15px;line-height:70px"><a style="font-size:1.5em;" class="list" href='" + entry.video_url + "'>" + entry.title[0] + "</a></li>";
}else {
return "<li class="itemListClass" id="movieListId" style="padding-left: 15px;margin-left: 10px;line-height:70px"><a style="font-size:1.5em;" class="list" href='" + entry.video_url + "'>" + entry.title[0] + "</a></li>";
}
i have tried with $("#listUl").focus(); to focus the first item of listView after opening side panel without luck, i use this app on tv so no mouse or click only keyboard (by remote control). my second goal is after focusing the first item in the filtered listview , i can navigate (focusing) second and third and nth element by keyboard. please help me
javascript jquery css jquery-mobile
New contributor
Hamid is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
up vote
1
down vote
favorite
I am developing an app for tizen tv samsung. it use jquery mobile 1.3.2 my goal is after typing in input and searching an item from listview first item in listview would be focused ( i use jquery.sidebar.min.js to show my listview in that dynamic panel) . please show the code in demo (like jsfidle)
<input id='input' type='text'>
<ol id="listUl" data-role="listview" data-icon="false" style="margin-right: 5px;">
//dynamic list view
document.getElementById('input').addEventListener('change', function() {
$("#input").on('keyup', function(){
var value = $(this).val().toLowerCase();
$("#listUl li").each(function () {
if ($(this).text().toLowerCase().search(value) > -1) {
$(this).show();
$("#listUl").focus();
$(this).prev('.itemListClass').last().show();
} else {
$(this).hide();
}
});
});
// here is how i dynamicly with json parsing add list of item
if (ind === 1) {
return "<li class="itemListClass" id="movieListId" data-theme="b" style="padding-top:25px;padding-left: 15px;line-height:70px"><a style="font-size:1.5em;" class="list" href='" + entry.video_url + "'>" + entry.title[0] + "</a></li>";
}else {
return "<li class="itemListClass" id="movieListId" style="padding-left: 15px;margin-left: 10px;line-height:70px"><a style="font-size:1.5em;" class="list" href='" + entry.video_url + "'>" + entry.title[0] + "</a></li>";
}
i have tried with $("#listUl").focus(); to focus the first item of listView after opening side panel without luck, i use this app on tv so no mouse or click only keyboard (by remote control). my second goal is after focusing the first item in the filtered listview , i can navigate (focusing) second and third and nth element by keyboard. please help me
javascript jquery css jquery-mobile
New contributor
Hamid is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I am developing an app for tizen tv samsung. it use jquery mobile 1.3.2 my goal is after typing in input and searching an item from listview first item in listview would be focused ( i use jquery.sidebar.min.js to show my listview in that dynamic panel) . please show the code in demo (like jsfidle)
<input id='input' type='text'>
<ol id="listUl" data-role="listview" data-icon="false" style="margin-right: 5px;">
//dynamic list view
document.getElementById('input').addEventListener('change', function() {
$("#input").on('keyup', function(){
var value = $(this).val().toLowerCase();
$("#listUl li").each(function () {
if ($(this).text().toLowerCase().search(value) > -1) {
$(this).show();
$("#listUl").focus();
$(this).prev('.itemListClass').last().show();
} else {
$(this).hide();
}
});
});
// here is how i dynamicly with json parsing add list of item
if (ind === 1) {
return "<li class="itemListClass" id="movieListId" data-theme="b" style="padding-top:25px;padding-left: 15px;line-height:70px"><a style="font-size:1.5em;" class="list" href='" + entry.video_url + "'>" + entry.title[0] + "</a></li>";
}else {
return "<li class="itemListClass" id="movieListId" style="padding-left: 15px;margin-left: 10px;line-height:70px"><a style="font-size:1.5em;" class="list" href='" + entry.video_url + "'>" + entry.title[0] + "</a></li>";
}
i have tried with $("#listUl").focus(); to focus the first item of listView after opening side panel without luck, i use this app on tv so no mouse or click only keyboard (by remote control). my second goal is after focusing the first item in the filtered listview , i can navigate (focusing) second and third and nth element by keyboard. please help me
javascript jquery css jquery-mobile
New contributor
Hamid is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
I am developing an app for tizen tv samsung. it use jquery mobile 1.3.2 my goal is after typing in input and searching an item from listview first item in listview would be focused ( i use jquery.sidebar.min.js to show my listview in that dynamic panel) . please show the code in demo (like jsfidle)
<input id='input' type='text'>
<ol id="listUl" data-role="listview" data-icon="false" style="margin-right: 5px;">
//dynamic list view
document.getElementById('input').addEventListener('change', function() {
$("#input").on('keyup', function(){
var value = $(this).val().toLowerCase();
$("#listUl li").each(function () {
if ($(this).text().toLowerCase().search(value) > -1) {
$(this).show();
$("#listUl").focus();
$(this).prev('.itemListClass').last().show();
} else {
$(this).hide();
}
});
});
// here is how i dynamicly with json parsing add list of item
if (ind === 1) {
return "<li class="itemListClass" id="movieListId" data-theme="b" style="padding-top:25px;padding-left: 15px;line-height:70px"><a style="font-size:1.5em;" class="list" href='" + entry.video_url + "'>" + entry.title[0] + "</a></li>";
}else {
return "<li class="itemListClass" id="movieListId" style="padding-left: 15px;margin-left: 10px;line-height:70px"><a style="font-size:1.5em;" class="list" href='" + entry.video_url + "'>" + entry.title[0] + "</a></li>";
}
i have tried with $("#listUl").focus(); to focus the first item of listView after opening side panel without luck, i use this app on tv so no mouse or click only keyboard (by remote control). my second goal is after focusing the first item in the filtered listview , i can navigate (focusing) second and third and nth element by keyboard. please help me
javascript jquery css jquery-mobile
javascript jquery css jquery-mobile
New contributor
Hamid is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Hamid is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
edited Nov 10 at 20:35
New contributor
Hamid is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
asked Nov 10 at 3:54
Hamid
205
205
New contributor
Hamid is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Hamid is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Hamid is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Hamid is a new contributor. Be nice, and check out our Code of Conduct.
Hamid is a new contributor. Be nice, and check out our Code of Conduct.
Hamid is a new contributor. Be nice, and check out our Code of Conduct.
Hamid is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53235866%2fjquery-mobile-how-focus-to-that-item-after-filtering-searching-it%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
2XfoHB N9c2rygGojVbyCoDXM2w 0r0D 70ol5ynpnz8zq2EBD mkErjo0 voEdwgUzVc8upj3DUkcQlW3XAhG