Problem with Update ASP "Formview" and Coolite "Gridpanel" in one aspx

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Problem with Update ASP "Formview" and Coolite "Gridpanel" in one aspx



    Hi all, I've try to use coolite coding on a asp.net page which need access/update on one master table and a linked subtable, same structure as [order] and [orderdetail].
    The page "OrderDetail.aspx" is intend to provide view/update function in one page, I use asp:formview to display data from SQL datasource, and use ext:GridPanel to show orderdetail grid.

    When user create a new order, input order detail on grid and click submit button, I need to call FormViewOrder.InsertItem() to insert data in master table, and get the new id @id from reture value, then update all OrderId in subtable and save, via call client function #{GridPanelOrderList}.save() in listener.

    I try to attach the AjaxEvents and Listener in one button, but they seems work seperately, so cause new OrderID can't be retrieve when gridpanel update. For temp solition, I split them in too button, just like below:

        ...
    
        <asp:SqlDataSource ID="SqlDataSourceOrder" runat="server" 
            ConnectionString="xxxxxxxx"
            selectcommand = "SELECT * FROM TB_Order"
            ......
            >
        </asp:SqlDataSource>
    
    
        <asp:SqlDataSource ID="SqlDataSourceOrderDetail" runat="server" 
            ConnectionString="xxxxxxxx"
            selectcommand = "SELECT * FROM TB_OrderDetail where OrderID=xxx"
            OnInserted="SqlDataSourceOrder_Inserted"
            ......
            >
        </asp:SqlDataSource>
    
    
        <ext:Store ID="StoreOrderDetail" runat="server" DataSourceID="SqlDataSourceOrderDetail"
            OnBeforeRecordInserted ="StoreOrderDetail_BeforeRecordInserted"
            >
            <Reader>
                <ext:JsonReader ReaderID="OrderDetailID">
                    <Fields>
                        <ext:RecordField Name="OrderID" />
                        ......
                    </Fields>
                </ext:JsonReader>
            </Reader>
        </ext:Store>
    
        ...
    
        <asp:FormView ID="FormViewOrder" runat="server" DataKeyNames="OrderID" DataSourceID="SqlDataSourceOrder" DefaultMode="Insert">
            <ItemTemplate>
            ......
            </ItemTemplate>
            <InsertItemTemplate>
            </InsertItemTemplate>
        </asp:FormView>
    
        <ext:GridPanel ID="GridPanelOrderDetail" runat="server"  StoreID="StoreOrderDetail"
        ...
        >
    
        ...
    
        <ext:Button ID="btnNext1" runat="server" Text="Save Order" Icon="Accept">
            <AjaxEvents>
                <Click OnEvent="SaveOrder">
            </AjaxEvents>                                        
        </ext:Button>
    
        <ext:Button ID="btnNext2" runat="server" Text="Save Order Detail" Icon="Accept">
            <Listeners>
                <Click Handler="#{GridPanelOrderDetail}.save();" />
            </Listeners>
        </ext:Button>
    My question are:
    1. how can I combine they together ?
    2. I fell it's not a good solution to use formview and gridpanel together, because they are using different programing method, is there any solution in coolite to replace forview/detail view work with datasource and store?

    Pls kindly help, thanks a lot!




  2. #2

    RE: Problem with Update ASP "Formview" and Coolite "Gridpanel" in one aspx

    Have you taken a look at these examples:

    https://examples1.ext.net/#/GridPane...SqlDataSource/

    https://examples1.ext.net/#/GridPane.../Form_Details/

    The first demonstrate how to bind editable data from a SqlDataSource to an ext:GridPanel control while handling the inserting, updating and deleting using Ajax.

    And the second demonstrates how to bind a FormGroup to a GridPanel selection.
  3. #3

    RE: Problem with Update ASP "Formview" and Coolite "Gridpanel" in one aspx

    Dear mindcore1, thanks for your reply, but it semmes not what I need, my problem is the different update method of formview and gridpanel. Also the 2nd example is list / detail view, the value in detail form is update one by one in event handler, not binding with store or datasource, so not same problem in my coding.
    Any way, still thanks a lot.
  4. #4

    RE: Problem with Update ASP "Formview" and Coolite "Gridpanel" in one aspx

    Hi Simon,

    Have you found any solution?. I am also in need of same thing.

    If so then please share with me.

    Thanks


Similar Threads

  1. Replies: 4
    Last Post: Mar 29, 2012, 3:36 PM
  2. Coolite control like asp:FormView ?
    By Penunuri in forum 1.x Help
    Replies: 2
    Last Post: Feb 02, 2009, 9:30 PM
  3. Replies: 4
    Last Post: Dec 16, 2008, 3:55 PM
  4. Replies: 1
    Last Post: Nov 16, 2008, 5:16 AM
  5. Replies: 1
    Last Post: Nov 14, 2008, 4:36 AM

Posting Permissions