Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to make two sets of selection by JQuery UI selectable widget?
    primarykey
    data
    text
    <p>I am trying to use UI Selectable to make two sets of selections.</p> <p>The process is like this:</p> <p>First, I select several rows then click a button to set to finish this first round selection. And the selected rows will be highlighted to a color, i.e. "red". Then, I begin second round selection. This second round selection should not change the color of the first round selected rows. After second round selection, click a button to set the finish of second round selection; and this second round selection will be highlighted by another color, say, "green".</p> <p>I can easily make the first round selection, but I can not figure out how to make the second round selection while keep my first round selection color unchanged. I can manually add an id to the first round selection, but I don't know how to keep the first round selection's color unchanged when I make the second round selection. I even tried to make a new css style for the first round selected results to keep its highlighted color, but it just didn't work.</p> <p>add some code here:</p> <pre><code>&lt;!--&lt;link rel="stylesheet" type="text/css" href="js/themes/blue/style.css"/&gt;--&gt; &lt;link rel="stylesheet" type="text/css" href="js/css/redmond/jquery-ui-1.8.20.custom.css"&gt; &lt;style&gt; #tablebody .ui-selecting { background: #F5F5DC; } #tablebody .ui-selected { background: #98F5FF; color: black; } .ui-selected-grp1 {background: red; color: black; } #tablebody { list-style-type: none; margin: 0; padding: 0; width: 60%; } #tablebody tr { margin: 3px; padding: 0.4em; font-size: 1.4em; height: 18px; } &lt;/style&gt; &lt;script src="js/jquery-1.7.2.min.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script src="js/jquery.tablesorter.min.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script src="js/js/jquery-ui-1.8.20.custom.min.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(document).ready(function(){ $("#metatable").tablesorter(); $("#tablebody").selectable(); $('#grp1').click(function(){ $('tr.ui-selected').addClass('ui-selected-grp1'); return false; }) }) &lt;/script&gt; </code></pre> <p>As you can see, I try to add class "ui-selected-grp1" to control the first round selection color, but it didn't work. When I began to make a second round selection, the highlight of first round was just gone. Could you give me some advice or code example for this process? </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload