View Full Version : [CLOSED] [#73] GridPanel's SelectionChange is being raised when deselecting all with supressEvent set to true

Dec 05, 2012, 6:46 PM
Run the following example, select one element and the press Click Me to Deselect ALL button. The SelectionChange is being raised when deselectAll is invoked. Note that it was invoked with suppressEvent parameter set to true, so i think that SelectionChange should not be raised.

deselectAll method reference:

1 - View

<!DOCTYPE html>
<head id="Head1" runat="server">
<script type="text/javascript">
var deselectAll = function () {
<ext:ResourceManager ID="ResourceManager1" runat="server" />
<ext:Button Text="Click Me to Deselect ALL" runat="server">
<Click Handler="deselectAll();" />
<ext:GridPanel ID="GridPanel1" runat="server" Title="Records">
<ext:Store runat="server" ID="Store2">
<ext:AjaxProxy Url="/Example/LoadFakeRecords/">
<ActionMethods Read="POST" />
<ext:JsonReader Root="data" />
<ext:Model ID="Model2" runat="server">
<ext:ModelField Name="Name" Type="String" />
<ext:DataSorter Property="Common" Direction="ASC" />
<ColumnModel ID="ColumnModel1" runat="server">
<ext:Column ID="Column3" runat="server" Text="Name" DataIndex="Name" />
<ext:CheckboxSelectionModel runat="server" />
<SelectionChange Handler="alert('Selection Change');" />

2 - Controller

public class ExampleController : System.Web.Mvc.Controller
public ActionResult Index()
return View();

public StoreResult LoadFakeRecords()

List<Person> lst = new List<Person>();

for (int index = 0; index < 15; index++)
lst.Add(new Person
Name = "Name" + index

return new StoreResult(lst, lst.Count());

3 - Utility

public class Person
public string Name { get; set; }

It's possible to overcome this issue by adding the following condition on line 14:

&& !suppressEvent

Ext.override(Ext.selection.Model, {
deselectAll: function (suppressEvent) {
var me = this,
selections = me.getSelection(),
i = 0,
len = selections.length,
start = me.getSelection().length;

me.bulkChange = true;
for (; i < len; i++) {
me.doDeselect(selections[i], suppressEvent);
delete me.bulkChange;
me.maybeFireSelectionChange(me.getSelection().leng th !== start && !suppressEvent);

I would like to know if this is a bug or if i need to register to Select and Deselect listeners

Thanks in advance

Dec 05, 2012, 7:02 PM
Please, take a look on ExtJs Forum regarding this issue:


Dec 06, 2012, 4:48 AM
Hi Raphael,

Thank you for the report!

I think it is a bug.

I reported it to Sencha.

Lets wait what they will answer.

Dec 06, 2012, 10:23 AM
Thank you Daniil, please keep me posted about any updated regarding this issue

Dec 06, 2012, 3:24 PM
Sencha opened a bug ticket.

We also opened an Issue to track this defect, see:

Jan 21, 2015, 1:46 PM
I confirm that this issue has been fixed in the SVN trunk. It will go to v3.1.0 beta release.