Selection and Hovering

29 May 20192 minutes to read

Selection provides an interactive support to highlight the card that you select. Selection can be done through simple Mouse down or Keyboard interaction. To enable selection, set allowSelection as true.

You can see the mouse hovering effect on the corresponding cards using allowHover property. By default selection and hovering is true.

Types of Selection

Two types of selections available in Kanban are,

  1. Single
  2. Multiple

Single Selection

To enable single selection by setting selectionType property as single.

Multiple Selection

Multiple selections is an interactive support to select a group of cards in Kanban by mouse or keyboard interactions. To enable multiple selections by set selectionType property as multiple.

You can select multiple random cards below key press.

Keys Description
Ctrl + mouse left To select multiple random cards.
Shift + mouse left To continuous cards select.

To unselect selected cards, by press “Shift + mouse left” click on selected row.

The following code example describes the above behavior.

  • HTML
  • <?php
        require_once '../EJ/AutoLoad.php';
        ?>
        <div class="cols-sample-area">
        <?php    
        $Json = '[{"Id": 1, "Status": "Open", "Summary": "Analyze the new requirements gathered from the customer.", "Type": "Story", "Priority": "Low", "Tags": "Analyze,Customer", "Estimate": 3.5, "Assignee": "Nancy Davloio", "ImgUrl": "Content/images/kanban/1.png", "RankId":1 }, { "Id": 2, "Status": "InProgress", "Summary": "Improve application performance", "Type": "Improvement", "Priority": "Normal", "Tags": "Improvement", "Estimate": 6, "Assignee": "Andrew Fuller", "ImgUrl": "Content/images/kanban/2.png", "RankId":1 }, { "Id": 3, "Status": "Open", "Summary": "Arrange a web meeting with the customer to get new requirements.", "Type": "Others", "Priority": "Critical", "Tags": "Meeting", "Estimate": 5.5, "Assignee": "Janet Leverling", "ImgUrl": "Content/images/kanban/3.png", "RankId":2 }, { "Id": 4, "Status": "InProgress", "Summary": "Fix the issues reported in the IE browser.", "Type": "Bug", "Priority": "Release Breaker", "Tags": "IE", "Estimate": 2.5, "Assignee": "Janet Leverling", "ImgUrl": "Content/images/kanban/3.png", "RankId":2 }, { "Id": 5, "Status": "Close", "Summary": "Fix the issues reported by the customer.", "Type": "Bug", "Priority": "Low", "Tags": "Customer", "Estimate": "3.5", "Assignee": "Steven walker", "ImgUrl": "Content/images/kanban/5.png", "RankId":1 }]';
        $Json = json_decode($Json,true);
        $kanban = new EJ\Kanban("default");    
        $column = new EJ\Kanban\Column();
        $column ->key("Open")->headerText("Backlog");    
        $column1 = new EJ\Kanban\Column();
        $column1 ->key("InProgress")->headerText("In Progress");    
        $column2 = new EJ\Kanban\Column();
        $column2 ->key("Close")->headerText("Done");    
        $fields = new EJ\Kanban\Field();
        $fields ->content("Summary")->primaryKey("Id");
        $columns = array( 
            $column,$column1,$column2
            );    
        echo $kanban ->columns($columns)->dataSource($Json)->selectionType("multiple")->fields($fields)->keyField("Status")->render();
        ?>
        </div>

    The following output is displayed as a result of the above code example.

    Selection and hovering in PHP kanban control