Using Coolite GridPanel without Coolite Store

  1. #1

    Using Coolite GridPanel without Coolite Store

    Is it possible to use Coolite Data controls without associating a Store with them??

    In my case, I have data in a System.Data.DataTable. Is it possible to set this DataTable as GridPanel's DataSource, and then DataBind the GridPanel??

    If no, is it possible to manually add columns & rows from the DataTable to the GridPanel?

    If even this is not possible, then how could I make a Store pick up data from a DataTable? The number of columns in the DataTable is dynamic, and hence Store's Fields can not be assigned in markup. They have to be added dynamically in code-behind. Some sample code would be highly appreciated.
  2. #2

    RE: Using Coolite GridPanel without Coolite Store

    Hi,

    No, You must bind a Store only. The GridPanel can't work without a Store.
    You can create store fields and grid columns dynamically
    Please see the following topic
    http://forums.ext.net/showthread.php...4393-16-1.aspx
    *
  3. #3

    RE: Using Coolite GridPanel without Coolite Store

    Yes, I already figured that out:
    Here's the code I have created:

    <ext:Store runat="server" ID="store1">
        <Reader>
            <ext:JsonReader>
                <Fields>
                </Fields>
            </ext:JsonReader>
        </Reader>
        <%--<SortInfo Field="containerId" Direction="ASC" />--%>
        <Listeners>
            <LoadException Handler="Ext.Msg.alert('Students - Load failed', e.message || e )" />
        </Listeners>
    </ext:Store>
    
    <ext:GridPanel runat="server" ID="gridPanel1" StoreID="store1" Title="Students" BodyBorder="true" Border="true" Header="true" Height="400px">
        <ColumnModel runat="server">
            <Columns></Columns>
        </ColumnModel>
        
        <SelectionModel>
            <ext:RowSelectionModel runat="server" SingleSelect="false"></ext:RowSelectionModel>
        </SelectionModel>
        
        <LoadMask ShowMask="true" />
    </ext:GridPanel>
    And here's the code-behind:
                    Dim dt As DataTable = SearchController.executeMemberSearch(processor.result, Me.PortalId, False, True, 10000)
    
                    For Each field As SearchField In collection
                        Me.store1.Reader(0).Fields.Add(New Coolite.Ext.Web.RecordField(field.headerText))
                        Me.gridPanel1.ColumnModel.Columns.Add(New Coolite.Ext.Web.Column() With {.DataIndex = field.headerText, .Header = field.headerText})
                    Next
    
                    Me.store1.DataSource = dt
                    Me.store1.DataBind()
    I have used some proprietary classes in the above code. Rest all should be pretty clear.

    There are 2 problems I am facing now:
    1) LoadMask is NOT being shown. Can someone figure out why?
    2) The above code generates 250 rows with 100 columnseach. It takes a lot of time to populate the grid. Is there something I can do to optimize things. Any other option except Paging. This data has to be shown together on a single page. Is there something I can do to optimize &amp; minimize the JSon data moving around. I would not hesitate to switch Readers if one reduces the data travelling.
  4. #4

    RE: Using Coolite GridPanel without Coolite Store

    Hi,

    The LoadMask shows when initiate request to load data to the browser. If you don't use any proxy then data rendred to the page. Therefore you don't see mask because *data is loaded to the store already.


    I don't think that use 250 rows and 100 columns is good idea (you rendered 25000 cells plus service markup). Please note that it is used in browser (not Excel :) ). So, That amount of data will be rendered a lot time (independently of reader)




  5. #5

    RE: Using Coolite GridPanel without Coolite Store

    Well, it is NOT really my choice. What can I do if the Client wants it that way? The only thing is optimization to make it look like as fast as possible.

    Anyways, which one is a better approach, load data to a page, or load using a proxy? Again, my criteria would be performance plus apparent load time. I mean, if using a proxy, the apparent load time improves, I might consider using that.

    By apparent load time, I mean, that without a proxy, no row is displayed until the entire page is loaded. If using a proxy, rows are displayed as they arrive, that might give a feeling of faster load time, while it is not really so.
  6. #6

    RE: Using Coolite GridPanel without Coolite Store

    The proxy only load data to the store. So, the proxy can't improve performance of grid render. The Grid starts row rendering after all data loaded to the store (because we can't separate rows at the store)

  7. #7

    RE: Using Coolite GridPanel without Coolite Store

    Thanx. I would see if I can do anything else to improve.

Similar Threads

  1. Replies: 0
    Last Post: Dec 30, 2010, 1:13 AM
  2. Replies: 2
    Last Post: May 06, 2010, 8:08 AM
  3. Coolite 0.7 + Enum support in Store
    By echo in forum Open Discussions
    Replies: 1
    Last Post: Dec 16, 2008, 5:10 AM
  4. [CLOSED] help files for coolite? (extjs verses coolite)
    By pkellner in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Nov 25, 2008, 12:19 PM
  5. [CLOSED] Store disappeared from Coolite.Ext.Web on last nights svn?
    By pkellner in forum 1.x Legacy Premium Help
    Replies: 6
    Last Post: Oct 03, 2008, 12:20 PM

Posting Permissions