[CLOSED] SelectField in editable grid - Cannot get it to work.

Threaded View

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

    [CLOSED] SelectField in editable grid - Cannot get it to work.

    When editing a record, the SelectField always shows the value "Object 1" as the initial value. I think it should show a different value for each of the record in the example, "Object 1", "Object 2" and "Object 3":

    Controller-code:
    public class TestController : Controller
    {
            public ActionResult GetMainSet()
            {
                return Json(new List<object>
                {
                    new { text="Main 1", selected=1 },
                    new { text="Main 2", selected=2 },
                    new { text="Main 3", selected=3 }
                }, JsonRequestBehavior.AllowGet);
            }
    
            public ActionResult GetSelectables()
            {
                return Json(new List<object>
                {
                    new { text="Object 1", value=1 },
                    new { text="Object 2", value=2 },
                    new { text="Object 3", value=3 }
                }, JsonRequestBehavior.AllowGet);
            }
    }
    View-code:
    @{
        var x = Html.X();
    }
    @(
        x.Grid()
            .FullScreen(true)
            .Title("SelectField test")
            .Store(x.Store()
                .Fields(
                    x.ModelField().Name("text"),
                    x.ModelField().Name("selected")
                )
                .Proxy(x.AjaxProxy()
                    .Url("/Test/GetMainSet")
                )
            )
            .Plugins(x.EditableGrid())
            .Columns(
                x.Column()
                    .DataIndex("text")
                    .Text("text")
                ,
                x.Column()
                    .Text("selected")
                    .DataIndex("selected")
                    .Editable(true)
                    .Editor(x.SelectField()
                        .Store(x.Store()
                            .Proxy(x.AjaxProxy()
                                .Url("/Test/GetSelectables")
                            )   
                        )
                    )
            )
    )
    Last edited by fabricio.murta; Jan 03, 2017 at 9:35 PM. Reason: no user feedback for 7+ days

Similar Threads

  1. [CLOSED] Editable Plugin doesn't work with Chrome
    By anup in forum 1.x Legacy Premium Help
    Replies: 7
    Last Post: Jul 03, 2013, 4:37 AM
  2. Replies: 9
    Last Post: Feb 14, 2013, 2:55 PM
  3. Replies: 12
    Last Post: Sep 07, 2012, 2:42 PM
  4. Replies: 3
    Last Post: Feb 22, 2012, 12:56 PM
  5. Replies: 1
    Last Post: Jan 28, 2009, 7:36 PM

Posting Permissions