[CLOSED] Problem with store reload if de.Click.FormID is present in DirectEvents

  1. #1

    [CLOSED] Problem with store reload if de.Click.FormID is present in DirectEvents

    I have form panel inside window,and its contain a file upload along with other field.

    View CODE

     
    .ServerProxy(X.AjaxProxy()
                    .Url(Url.Action("reloadgrid", "VendorRegistration"))
                    .Reader(X.JsonReader().Root("data"))
                )
    
    
    X.Button()
                                                            .Text("Save")
                                                            .ID("btnSave")
                                                            .Listeners(l => l.Click.Handler = "return validation();")
    
                                                            .DirectEvents(de =>
                                                            {
                                                                de.Click.FormID = "f";
                                                                de.Click.Action = "save";
                                                                de.Click.EventMask.ShowMask = true;
                                                                de.Click.EventMask.Msg = "Saving...";
                                                                de.Click.EventMask.MinDelay = 100;
                                                                de.Click.Complete = "App.GridPanel1.getStore().reload();";
                                                            })



    controller code

     public ActionResult reloadgrid()
            {
                object[] o = GetData().Cast<object>().ToArray();
                return this.Store(o);
            }
    the problem is if de.Click.FormID = "f"; present then reloadgrid function is not called. but if i remove de.Click.FormID = "f"; the reloadgrid function is called but i am not getting value from controls inside from.I try with de.Click.Success also.

    I fond if save action return type is void then reloadgrid function is called ,but I have a fileupload filed inside the formpanel
    so my save action return type is DirectResult,and end of this f unction i write
    DirectResult result = new DirectResult();
    result.IsUpload = true;
    I f i not doing this then fileupload give an error.

    please see http://legalinfoservices.com/file.zip,I think from this 2 file you will understand the scenario
    Last edited by Daniil; Jul 08, 2014 at 5:24 AM. Reason: [CLOSED]
  2. #2
    Hi @matrixwebtech,

    It is better to post all the related code (simplified) directly here. Zips are not required mostly. If it is required for some reason, we request it.

    I see the following in your code:
    DirectResult result = new DirectResult();
    result.IsUpload = true;
    return CleareFields();
    Yes, you are right that you set IsUpload to true, but you don't return that result.

    It should be like that:
    DirectResult result = new CleareFields();
    result.IsUpload = true;
    return result;
    If there is an upload action, please ensure it always returns a DirectResult with .IsUpload set to true.

Similar Threads

  1. [CLOSED] Problem with store reload
    By matrixwebtech in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: Jun 21, 2014, 6:02 PM
  2. Replies: 2
    Last Post: May 24, 2013, 1:54 AM
  3. [CLOSED] Problem with focusRow() on Store.reload() with Firefox
    By csharpdev in forum 1.x Legacy Premium Help
    Replies: 21
    Last Post: Nov 18, 2010, 11:26 AM
  4. Store.reload() problem
    By Dgsoft.ru in forum 1.x Help
    Replies: 1
    Last Post: May 28, 2009, 2:14 PM
  5. Databind / Reload Store and GridPanel Problem
    By locoperoguapo in forum 1.x Help
    Replies: 5
    Last Post: Feb 10, 2009, 9:23 AM

Posting Permissions