[OPEN] [#906] Ext.Net.MVC: ModelFor method

  1. #1

    [OPEN] [#906] Ext.Net.MVC: ModelFor method

    Hello,

    In Html.X() I see StoreFor and ModelNameFor methods, but ModelFor method is missed. But this method very useful if some model values (e.g. IdProperty) can be changed. For example:

    X.Store(
        .Model(X.ModelFor(m=>m)
            .IdProperty("CustomId")
        )
    )
    Now I don't see any way to set idProperty in StoreFor and have to add model and all model fields.
    Last edited by Daniil; Sep 22, 2015 at 6:20 PM. Reason: [OPEN] [#906]
  2. #2
    Hi Yury,

    Thank you for a feature request.

    Please clarify is a [ModelField(IDProperty = true)] attribute on a Model's property not helpful in your scenario? If it is not, then there is the following way:
    Html.X().StoreFor<Work3MVC.Controllers.Employee>()
        .Model(model => model[0].IDProperty = "CustomId")
  3. #3
    Thank you for suggestions, but I think, ModelFor will be easier way to set IdProperty and other model attributes.
  4. #4
    Agree, it would be good to have.

    I created a feature request issue.
    https://github.com/extnet/Ext.NET/issues/906

    Though, since there is a solution (and it is not quite complicated) it is not going to have a high priority. From other side the Ext.NET community could increase the priority if more feedback like "I would like to see it implemented" appears.

Similar Threads

  1. Ext.net.Insert Method
    By phuongnv5 in forum 2.x Help
    Replies: 6
    Last Post: Jul 31, 2014, 10:15 AM
  2. Replies: 1
    Last Post: Jul 25, 2011, 10:59 AM
  3. Method confusions
    By jchau in forum Open Discussions
    Replies: 0
    Last Post: May 26, 2009, 1:10 PM
  4. Method Post / Get
    By heysol in forum 1.x Help
    Replies: 2
    Last Post: Mar 30, 2009, 2:16 PM
  5. method call
    By mono in forum 1.x Help
    Replies: 1
    Last Post: Mar 09, 2009, 7:46 AM

Posting Permissions