update grid data

  1. #1

    update grid data

    Hello!
    I have a gridpanel to change data in db:
                                                                    X.GridPanel()
                                                                    .ID("GridPanel1")
                                                                    .Title("Expander Rows with control")
                                                                    .Icon(Icon.Table)
                                                                    .Width(800)
                                                                    
                                                   
                                                   
                     .Store(Html.X().StoreForModel().ID("Store1").AutoSync(true).ShowWarningOnFailure(false)
                                                                        .Listeners(l =>
                                                                        {
                                                                            l.Exception.Fn = "onStoreException";
                                                                            l.Exception.Buffer = 10;
                                                                            
                                                                        })
                                                                        .SyncUrl(Url.Action("HandleChanges"))
    
                                                                    )
                                                                    .ColumnModel(
                                                                        Html.X().ColumnFor(Model, m => m.id)
                                                                        .ToBuilder<Column.Builder>()
                                                                        .Text("ID")
                                                                        .Width(50),
    i change data and correct it in database by update handler:
     public ActionResult HandleChanges(StoreDataHandler handler)
            { List<Requests> readyTask = handler.ObjectData<TestMVC.Models.Requests>();
    if (handler.Action == StoreAction.Update)
                { manipulations with db }
    
    return (ActionResult)this.Store(data);
    In my DB all changes gone OK, how i can update my grid (after that update some rows must gone, because model data will not grab they in query).
    For test i create a button (refresh btn:) ) with handler: this.up('grid').getView().refresh();
    after refresh updated row dissaper, BUT grid have a same count of rows (with doble rows)
  2. #2
    Hello, @vitaly2020!

    I fear I will have to repeat myself with the last response we provided you. We need a test case.

    Just for reference, these are the links for guidelines on posting helpful threads (helpful in the concept of threads where you "help us help you"):

    - Tips for creating simplified code samples
    - More Information Required
    - Forum Guidelines

    We should not repeat this for you, sorry for the inconvenience. We honestly looked up your sample but couldn't get anything that suggests a reason for the double rows you are getting from the sync result.

    Hope you understand.
    Fabrício Murta
    Developer & Support Expert

Similar Threads

  1. Replies: 5
    Last Post: Aug 15, 2017, 4:30 AM
  2. Replies: 1
    Last Post: Oct 27, 2014, 8:46 AM
  3. Replies: 9
    Last Post: Jun 18, 2014, 1:24 PM
  4. Replies: 4
    Last Post: Jun 11, 2013, 6:02 AM
  5. Update data and refreshing grid on server-side !
    By Aleksa007 in forum 1.x Help
    Replies: 0
    Last Post: Mar 03, 2011, 12:25 AM

Posting Permissions