How to change gridpanel selection model selection mode (single/multiple) from client side (javascript)?

  1. #1

    How to change gridpanel selection model selection mode (single/multiple) from client side (javascript)?

    Hi guys,

    Is there a way to change gridpanels selection model using javascript?

    Hers is my problem - my target gridpanel is with checkbox selection model (by default single select). It's in an user control page. When using this user control inside an ext window, i want to change selection model's selection mode to multi select based on some conditions.

    I tried changing the selection mode from code behind but all without any affect. Possibly a viewstate issue. Here's a snippet i tried, but it resulted the grid to disappear!! :(

    
    grdAuditableUnit.SelectionModel.Clear();  
    //CheckboxSelectionModel csm = new CheckboxSelectionModel();  
    //csm.ID = "CheckboxSelectionModel1"; 
    //csm.CheckOnly = false;  
    //grdAuditableUnit.SelectionModel.Add(csm); 
    grdAuditableUnit.SelectionModel.Add(new CheckboxSelectionModel { CheckOnly = false });  
    ///grdAuditableUnit.Reconfigure(); 
    grdAuditableUnit.Render();
    Any help with small exaple is highly appreciated. Thanks
  2. #2
    Any update regarding this issue?
  3. #3
    Hello,

    The code provided in the sample looks correct.
    Geoffrey McGill
    Founder
  4. #4
    Quote Originally Posted by RCN View Post
    Any update regarding this issue?
    Hi,

    Here's the snippet under Listener for changing selection model of a grid from client side - #{yourTargetGridPanel}.getSelectionModel().singleS elect=true;

    If you set the value to 'false', it will by default prepare the selection model for multi select.

    Hope it helps.

Similar Threads

  1. Replies: 2
    Last Post: Mar 19, 2012, 8:55 PM
  2. Replies: 1
    Last Post: Mar 11, 2012, 3:03 AM
  3. Replies: 2
    Last Post: Dec 29, 2011, 10:05 PM
  4. Replies: 2
    Last Post: Aug 09, 2011, 10:38 AM
  5. Replies: 0
    Last Post: Mar 05, 2011, 12:17 PM

Posting Permissions