Ajax Post

  1. #1

    Grid

    In Razor, I have a gridpanel with this code:
    Html.X.GridPanel() _
                                                   .ID("MyCedents") _
                                                   .Layout(LayoutType.Fit) _
                                                   .Width(500) _
                                                   .Height(250) _
                                                   .Scroll(ScrollMode.Vertical) _
                                                   .ColumnModel(Sub(colModel)
                                                                        colModel.Columns.Add(Html.X.Column() _
                                                                                             .DataIndex("Number").Text("Number"))
                                                                        colModel.Columns.Add(Html.X.Column() _
                                                                                             .DataIndex("Name").Locked(True).Text("Name"))
                                                                End Sub) _
                                                   .Store(Sub(dStore)
                                                                  dStore.Add(Html.X.Store().AutoLoad(True) _
                                                                             .Model(Sub(mdl)
                                                                                            mdl.Add(Html.X().Model.Fields(Sub(fields)
                                                                                                                                  fields.Add(Html.X.ModelField.Name("Number"))
                                                                                                                                  fields.Add(Html.X.ModelField.Name("Name"))
                                                                                                                          End Sub))
                                                                                    End Sub) _
                                                                             .PageSize(10) _
                                                                             .Proxy(Sub(proxy)
                                                                                            proxy.Add(Html.X.AjaxProxy().Url("/Assignments/TeamMemberCedents/" + MvcApplication.CurrentApplicationUser.EmployeeID.ToString()) _
                                                                                                      .Reader(Sub(rdr)
                                                                                                                      rdr.Add(Html.X.JsonReader().Root("Data"))
                                                                                                              End Sub))
                                                                                    End Sub) _
                                                                              .Sorters(Sub(action)
                                                                                               action.Add(Html.X.DataSorter.Property("Name").Direction(Ext.Net.SortDirection.ASC))
                                                                                       End Sub))
                                                          End Sub)
    The weird thing is that the grid panel loads, but the columns are not in the order that I have them listed in my column model. The column "Name" shows up first. Can you tell me why? Also, how can I make the columns expand to fill the width of the grid.
    Last edited by adelaney; Apr 13, 2012 at 7:53 PM. Reason: Format the code.
  2. #2
    Hi,

    Quote Originally Posted by adelaney View Post
    The weird thing is that the grid panel loads, but the columns are not in the order that I have them listed in my column model. The column "Name" shows up first. Can you tell me why?
    Because you set up
    Locked="true"
    for the Name column.

    It's considered to be a locked column which follows at the beginning.

    Quote Originally Posted by adelaney View Post
    Also, how can I make the columns expand to fill the width of the grid.
    Setting up
    Flex="1"
    for a Column.

    But, please note, that locked columns don't support Flex config option.

    See also
    http://docs.sencha.com/ext-js/4-0/#!....grid.Lockable

Similar Threads

  1. Replies: 0
    Last Post: Aug 14, 2012, 2:54 PM
  2. Replies: 0
    Last Post: Aug 14, 2012, 2:48 PM
  3. Replies: 0
    Last Post: Feb 11, 2010, 5:26 PM
  4. Replies: 3
    Last Post: Jan 13, 2010, 3:07 AM
  5. Page_ Ajax Load Complete BUG on Ajax Request
    By jeybonnet in forum 1.x Help
    Replies: 8
    Last Post: Jun 22, 2009, 11:19 AM

Posting Permissions