CGDevTools Forum

Welcome to the Official CGDevTools Support Community Forums.

Mobile list view - select item persistent

by buzud » 01 Mar 2017 19:39

When I select an item I show a side panel (with controls to adjust some list item data);
Now when the list item lost focus , I need to remain persistent selected and different as colour.

Is that possible? And if yes how ?
Can use CSS class of the
Code: Select all
.ui-listview li .selected {}
?

Thanks!
buzud
 
Posts: 17
Joined: 18 Oct 2016 13:29

by Alexander Bulei » 02 Mar 2017 16:50

Hi,

The jquery mobile framework, doesnt add any css class on click, so you must do it by yourself:

javascript code
function (event, ui){
$(event.currentTarget).closest('ul').find('li.custom-selected').removeClass('custom-selected');
$(event.currentTarget).addClass('custom-selected');
}


Put this click on each Item.OnVClick.Script, and them style your item with:

css code
li.custom-selected{
background:red;
}


Best Regards.
Group: Developers | Support Team

  • info [at] cgdevtools.com - General information
  • sales [at] cgdevtools.com - Sales department
  • support [at] cgdevtools.com - Product and Technical Support
User avatar
Alexander Bulei
Site Admin
 
Posts: 3635
Joined: 15 May 2012 08:52
Location: Mealhada, Portugal

by buzud » 02 Mar 2017 17:35

Dear Alexander,

Works perfect !
This model will help me a lot...
thank you very much!

Dan
buzud
 
Posts: 17
Joined: 18 Oct 2016 13:29

by mstokes » 06 Nov 2017 03:04

If you just wish to use the default "Active Button" colours for the JQuery theme you are using, you can use this script instead and no need for custom CSS.

Code: Select all
function (event, ui){
$(event.currentTarget).closest('ul').find('li.ui-btn-active').removeClass('ui-btn-active');
$(event.currentTarget).addClass('ui-btn-active');
}
mstokes
 
Posts: 2
Joined: 26 Oct 2017 06:44


Return to JQMListView

cron

Who is online

Users browsing this forum: No registered users and 1 guest

Contact Us.