[CLOSED] How combobox automatically loads new value added in the form?

  1. #1

    [CLOSED] How combobox automatically loads new value added in the form?

    Hi,

    In same web page I used one combobox and text field. The text field is using to enter some information and save it in the database. All these saved information should auto reflect in combobox after click save. While initial load of the page the combobox loads with all saved values in the database and it should auto reflect with values added from webpage.
    Last edited by Daniil; Mar 22, 2012 at 7:23 PM. Reason: [CLOSED]
  2. #2
    Hi,

    You should reload the ComboBox Store.
    ComboBox1.getStore().reload();
    The Store must have an OnRefreshData handler.

    Or, even, you can bind a new data directly within server side saving handler.
  3. #3
    Hi Daniil,

    Is it compulsory the store object? I just adding the db values directly like following, and calling this same method every time I add value to the database.

    Public Sub LoadCategories()
            Dim i As Integer
            Dim ds As New DataSet
            Dim cda As New clsDataAccess
            ds = cda.getDataSet("select * from UserContactCategory where Employee_ID=" & Session("LogID").ToString())
    
            If ds.Tables.Count > 0 Then
                If ds.Tables(0).Rows.Count > 0 Then
                    For i = 0 To ds.Tables(0).Rows.Count - 1
                        cboCategory.Items.Add(New Ext.Net.ListItem(ds.Tables(0).Rows(i)("CategoryName"), ds.Tables(0).Rows(i)("CategoryId")))
                    Next
                End If
            End If
    
            cboCategory.SelectedIndex = 0
        End Sub
    Quote Originally Posted by Daniil View Post
    Hi,

    You should reload the ComboBox Store.
    ComboBox1.getStore().reload();
    The Store must have an OnRefreshData handler.

    Or, even, you can bind a new data directly within server side saving handler.
  4. #4
    Is it compulsory the store object?
    In your case - no.

    During DirectEvent you should use the ComboBox AddItem, InsertItem, AddRecord or IndesrtRecord methods.

    See also
    https://examples1.ext.net/#/Form/Com...Items_Actions/

Similar Threads

  1. Expand combobox list automatically.
    By rahesh in forum 1.x Help
    Replies: 0
    Last Post: Nov 11, 2011, 12:12 PM
  2. [CLOSED] [1.0] ComboBox automatically clears value?
    By MP in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Sep 27, 2010, 7:20 PM
  3. Replies: 5
    Last Post: Aug 02, 2010, 1:30 PM
  4. [CLOSED] Why is it that form fields automatically bind to a store?
    By SandorD in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Jul 13, 2010, 12:24 AM
  5. Replies: 2
    Last Post: Feb 05, 2010, 6:46 PM

Tags for this Thread

Posting Permissions