[CLOSED] MVC Grid Component Column

  1. #1

    [CLOSED] MVC Grid Component Column

    I have a GridPanel for which I need to display a few combos - in edit mode. It seems that Ext doesn't quite understand "displayfor" and "editorfor" concepts so my first question is how to configure the grid (in Razor) to flip/flop based on the mode (display/edit). Also, I have 4 combo columns that I want to use the same data list. I already have a WCF service which returns a select list. Is there a way to use this data as the datasource for the combo or does Ext need some other type?
    Last edited by Daniil; May 18, 2012 at 4:53 PM. Reason: [CLOSED]
  2. #2
    Hi,

    Quote Originally Posted by adelaney View Post
    I have a GridPanel for which I need to display a few combos - in edit mode. It seems that Ext doesn't quite understand "displayfor" and "editorfor" concepts so my first question is how to configure the grid (in Razor) to flip/flop based on the mode (display/edit).
    Well, my initial thought is using two GridPanels (one - for display mode, another - for edit mode) within a container with CardLayout.

    Though please clarify what will be the difference between "display" and "edit" modes? Maybe, you could avoid using two GridPanels.

    Quote Originally Posted by adelaney View Post
    Also, I have 4 combo columns that I want to use the same data list. I already have a WCF service which returns a select list. Is there a way to use this data as the datasource for the combo or does Ext need some other type?
    You can define a single Store. Refer that Store to all ComboBoxes using its StoreID property.
  3. #3
    To clarify, when using a "read" pattern, you use the "displayfor" helper for the model, and you use an "editorfor" helper when in create or update. My point was simply that I want a grid that has no controls in "display" mode (just the selected text value) and a grid with combos in the "edit" mode. I have used other control components and they do this out of the box with MVC. I didn't know if maybe I just didn't know how to replicate this with Ext.

    As for the store, I tried that but the grid complained that it "could not find" a store with that ID. I defined my store before the grid - but both are in a partial view. Would any of that matter?

    Finally, as asked before, am I able to simply set the store's data to a selectList or do I have to provide data in a specific manner/format/object type? Here is an example of my store:

    @(Html.X.Store().ID("EmployeeData").DataSource((ViewData("Employees"))).DataBind())
  4. #4
    To clarify a little more. What I am tyring to accomplish is basically this demo:
    https://examples2.ext.net/#/GridPane...n/Over_Editor/

    Except I don't want an "over" command. Instead, I want an "edit" command which changes to a "save" or "cancel" when editing and I want 4 comboboxes which share the same datastore for the options. I see from my above example that the store is wrong, but even now when I have a store that doesn't produce an error, my grid keeps complaining that it doesn't exist which tells me that I don't have the store correct. However, after all that's done, I have to figure out my command columns and switching back and from from display to edit. :( Maybe I am too accustomed to other control sets, but I was hoping that this would be a lot easier to implement.
  5. #5
    I guess you need to use RowEditor
    By default, editor apperas after double click on a row
    https://examples2.ext.net/#/GridPane...ins/RowEditor/

Similar Threads

  1. [CLOSED] Dynamic header column component direct event Issue
    By legaldiscovery in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Dec 21, 2015, 10:56 PM
  2. Replies: 1
    Last Post: Nov 24, 2011, 6:48 AM
  3. Replies: 0
    Last Post: Feb 06, 2011, 4:17 PM
  4. [CLOSED] Grid Component in Row Expander
    By sharif in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Apr 22, 2010, 5:46 PM
  5. Replies: 1
    Last Post: May 22, 2009, 7:38 AM

Tags for this Thread

Posting Permissions