EasyUI Forum
May 03, 2024, 09:25:40 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Treegrid multiple select happens by field id rather than row id  (Read 7920 times)
scfrazer
Newbie
*
Posts: 2


View Profile Email
« on: October 06, 2016, 07:17:36 AM »

When using the treegrid and setting singleSelect to false, if you click a row then shift click another row further down, the rows selected are those between the two row ids, regardless of which rows are actually between the two clicked rows.  Here is an example, with eight rows in order except for the one with id=3:

Code:
<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>TreeGrid</title>
        <link rel="stylesheet" type="text/css" href="jquery-easyui/themes/default/easyui.css">
        <link rel="stylesheet" type="text/css" href="jquery-easyui/themes/icon.css">
        <script type="text/javascript" src="jquery.min.js"></script>
        <script type="text/javascript" src="jquery-easyui/jquery.easyui.min.js"></script>
    </head>
    <body>
        <table title="Hello World!" class="easyui-treegrid"
               data-options="idField: 'id', treeField: 'name', singleSelect: false, ctrlSelect: true">
            <thead>
                <tr>
                    <th data-options="field:'id'" width="50">Id</th>
                    <th data-options="field:'name'" width="100">Name</th>
                </tr>
            </thead>
            <tbody>
                <tr><td>0</td><td>a</td></tr>
                <tr><td>1</td><td>b</td></tr>
                <tr><td>2</td><td>c</td></tr>
                <tr><td>4</td><td>e</td></tr>
                <tr><td>5</td><td>f</td></tr>
                <tr><td>6</td><td>g</td></tr>
                <tr><td>3</td><td>d</td></tr>
                <tr><td>7</td><td>h</td></tr>
            </tbody>
        </table>
    </body>
</html>

If you click row 0, then shift-click row id=3 (the 7th row), it will select rows with ids=0..3, skipping rows with id=4..6 even though they are in-between the two clicked rows.  Similarly, click row id=0 and row id=4 and it will select row id=3 too even though it is not in-between.  I am using the free version (thanks BTW!), so the source code for the treegrid is obfuscated, but I could see enough that it looks like the multiple select is happening with min()/max() for the ids, rather than something like row indexes.

Thanks,
Scott
Logged
jarry
Administrator
Hero Member
*****
Posts: 2262


View Profile Email
« Reply #1 on: October 08, 2016, 08:51:09 AM »

Please download the patch from http://www.jeasyui.com/download/downloads/jquery-easyui-1.5-patch.zip.
Logged
scfrazer
Newbie
*
Posts: 2


View Profile Email
« Reply #2 on: October 10, 2016, 12:05:11 PM »

That fixes it, thanks!

Scott
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!