[CLOSED] Is it possible to Select Items of a multi select during ajax event

  1. #1

    [CLOSED] Is it possible to Select Items of a multi select during ajax event

    Dear Team,

    Is there any workaround to select the Items of Multi Select control during AjaxEvent? We are using 0.8.3 version of coolite.

    Here is my trial:

    Page Content:
    <formid="form1"runat="server">
    <ext:ScriptManagerID="smCoolite"runat="server">
    </ext:ScriptManager>
    <div>
    <ext:MultiSelectID="msTest"runat="server">
    <Items>
    <ext:ListItemText="One"Value="1"/>
    <ext:ListItemText="Two"Value="2"/>
    <ext:ListItemText="Three"Value="3"/>
    <ext:ListItemText="Four"Value="4"/>
    <ext:ListItemText="Five"Value="5"/>
    <ext:ListItemText="Six"Value="6"/>
    <ext:ListItemText="Seven"Value="7"/>
    <ext:ListItemText="Eight"Value="8"/>
    </Items>
    <Listeners>
    <ClickHandler="debugger;"/>
    </Listeners>
    </ext:MultiSelect>
    </div>
    <div>
    <ext:ButtonID="btnSelectItems"runat="server">
    <AjaxEvents>
    <ClickOnEvent="btnSelectItems_Click">
    </Click>
    </AjaxEvents>
    <Listeners>
    <ClickHandler="#{msTest}.selectedIds = Ext.decode('[1,2,3]');#{msTest}.render();"/>
    </Listeners>
    </ext:Button>
    </div>
    </form>
    And Code Behind is:
    using System;
    using System.Collections;
    using System.Configuration;
    using System.Data;
    using System.Linq;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.HtmlControls;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Xml.Linq;
    using Coolite.Ext.Web;
    publicpartialclassMultiSelectSelectionDuringAjaxEvent : System.Web.UI.Page
    {
    protectedvoid Page_Load(object sender, EventArgs e)
    {
     
    }
    protectedvoid btnSelectItems_Click(object sender, Coolite.Ext.Web.AjaxEventArgs e)
    {
    SelectedListItem sli = newSelectedListItem("One", "1", 0);
    msTest.SelectedItems.Add(sli);
    sli = newSelectedListItem("Two", "2", 1);
    msTest.SelectedItems.Add(sli);
    sli = newSelectedListItem("Three", "3", 2);
    msTest.SelectedItems.Add(sli);
    }
    }
    Regards,
    Last edited by geoffrey.mcgill; Jul 29, 2010 at 10:30 PM.
  2. #2
    Hello!

    Please use the UpdateSelection method.

    protected void btnSelectItems_Click(object sender, Coolite.Ext.Web.AjaxEventArgs e)
    {
        SelectedListItem sli = new SelectedListItem("One", "1", 0);
        msTest.SelectedItems.Add(sli);
        sli = new SelectedListItem("Two", "2", 1);
        msTest.SelectedItems.Add(sli);
        sli = new SelectedListItem("Three", "3", 2);
        msTest.SelectedItems.Add(sli);
        msTest.UpdateSelection();
    }
  3. #3
    To select items on client side please use the following code:
    <Listeners>
        <Click Handler="#{msTest}.setValue([1, 2, 3]);" />
    </Listeners>

Similar Threads

  1. Replies: 2
    Last Post: Feb 16, 2011, 9:36 AM
  2. Replies: 0
    Last Post: Feb 01, 2010, 1:42 PM
  3. Multi select items text not visible
    By ajaybabu.maddinani in forum 1.x Help
    Replies: 2
    Last Post: Dec 08, 2009, 8:49 AM
  4. Multi Select select/deselect
    By Palash in forum 1.x Help
    Replies: 2
    Last Post: Sep 18, 2009, 4:49 AM
  5. Multi Select - JIT
    By amitpareek in forum Open Discussions
    Replies: 1
    Last Post: Dec 09, 2008, 10:31 AM

Posting Permissions