Reload data of GridPanelFor

Page 2 of 2 FirstFirst 12
  1. #11
    Quote Originally Posted by Vladimir View Post
    It means that your controller action returns whole data. Just check what data your action returns
    I figured out that TriggerField listener is not working at all. When I click refresh on paging toolbar, its calling the function, but TriggerField ain't doing anyting

    Could you please check and help me with this ?
  2. #12
    I figured out that TriggerField listener is not working at all. When I click refresh on paging toolbar, its calling the function, but TriggerField ain't doing anyting
    I am not sure that understood you. How TriggerField listener is related with paging toolbar? Why do you expect that refresh button on paging toolbar should call TriggerField listener?
  3. #13
    Quote Originally Posted by Vladimir View Post
    I am not sure that understood you. How TriggerField listener is related with paging toolbar? Why do you expect that refresh button on paging toolbar should call TriggerField listener?
    Okay, sorry for the confusion.

    I need to say that if I am clicking on the refresh Icon, its calling the function.

    But when I am using the triggerfield, its not calling it at all. As per your instructions, I wrote the listener as App.Store1.load, but its not it.

    new FieldTrigger(new FieldTrigger.Config {Icon=TriggerIcon.Search })
                ).Listeners(
                        ls => ls.TriggerClick.Handler = "App.Store1.load({params: {_StudID: this.getValue()}});"
                )
  4. #14
    But when I am using the triggerfield, its not calling it at all.
    Do you mean that if click on trigger then controller action is not called?
    Please post Store configuration
  5. #15
    Quote Originally Posted by Vladimir View Post
    Do you mean that if click on trigger then controller action is not called?
    Please post Store configuration
    Yes you got it right :)

    GridPanel Code which include Store1
    X.GridPanel().ID("gridUsers").Region(Region.Center).FrameHeader(false).Frame(true).ForceFit(true)
    .Store(
            X.Store().ID("Store1").RemotePaging(true).DataSource(Model).Model(X.Model().Fields(
                X.ModelField().Name("ID"),
                X.ModelField().Name("Name"),
                X.ModelField().Name("Email"),
                X.ModelField().Name("Password"),
                X.ModelField().Name("PhoneNo"),
                X.ModelField().Name("Expert").Type(ModelFieldType.Boolean),
                X.ModelField().Name("Discount"),
                X.ModelField().Name("Sitename")
            )).ServerProxy(X.AjaxProxy().Url(Url.Action("GetDatabySiteID")))
        )
    
    .ColumnModel
        (
            X.Column().Text("Student ID").DataIndex("ID").MaxWidth(80),
            X.Column().Text("Student Name").DataIndex("Name"),
            X.Column().Text("Email").DataIndex("Email"),
            X.Column().Text("Password").DataIndex("Password").MaxWidth(100),
            X.Column().Text("Phone No").DataIndex("PhoneNo"),
            X.NumberColumn().Text("Credit").DataIndex("Discount").MaxWidth(60),
            X.CheckColumn().Text("Expert").DataIndex("Expert").MaxWidth(60),
            X.Column().Text("Registered with").DataIndex("Sitename").MaxWidth(130)
        )
        .BottomBar(
        X.PagingToolbar().DisplayInfo(true).StoreID("Store1").Plugins(X.ProgressBarPager())
        )
        .Plugins(
            X.LiveSearchGridPanel()
        )
        .TopBar(
            X.Toolbar().Items(
                X.Label().Text("User ID: "),
                X.TriggerField().ID("trguserID").Icon(Icon.Find).Width(100).Triggers(
                new FieldTrigger(new FieldTrigger.Config {Icon=TriggerIcon.Search })
                ).Listeners(
                        ls => ls.TriggerClick.Handler = "App.Store1.load({params: {StudID: this.getValue()}});"
                ),
                X.LiveSearchToolbar().HideRegExp(true).HideCaseSensitive(true).SaveDelay(1000).AutoFocus(true).AutoFocusDelay(1000)
                )
            )
        )
    )
    Controller Code

    public ActionResult Index()
            {
                return View(Admin.MVC.Areas.Modules.Models.UsersModel.GetDataBySiteID());
            }
    
            public StoreResult GetDatabySiteID(string SiteID="0", string StudID="0")
            {
    //This function is not working from TriggerField
                return this.Store(Admin.MVC.Areas.Modules.Models.UsersModel.GetDataByUserID(StudID));
            }
  6. #16
    If you use ServerProxy instead Proxy then you need to use reload method instead load
  7. #17
    Quote Originally Posted by Vladimir View Post
    If you use ServerProxy instead Proxy then you need to use reload method instead load
    Thanks man, its working now :)
Page 2 of 2 FirstFirst 12

Similar Threads

  1. Column Chart - Failed New Data Reload
    By DenisEdde in forum 2.x Help
    Replies: 4
    Last Post: Jun 27, 2013, 7:37 PM
  2. How to reload store data using mvc controller?
    By FlavioSilveira in forum 2.x Help
    Replies: 1
    Last Post: Feb 22, 2013, 4:22 AM
  3. How to reload CalendarPanel Data of Code-Behind?
    By easypower in forum 1.x Help
    Replies: 0
    Last Post: Jun 11, 2012, 3:37 AM
  4. Replies: 0
    Last Post: Sep 29, 2010, 8:11 PM
  5. Force combo to reload data?
    By plykkegaard in forum 1.x Help
    Replies: 2
    Last Post: Jan 05, 2010, 11:00 AM

Posting Permissions