javascript - How do I bind Ext JS controls with ASP.NET MVC? -


I am starting a new project with ASP.NET MVC, and I have to use ExtJs as a Widget Library (we are not going to 'MVC in customer') because the company has a license for it .

We have a bad experience binding to the HTML generated by the MVC from the previous project. We usually use MVC & lt; Input & gt; etc., generated ExtJS control based on their properties, and synchronizes the values ​​of both, it is difficult to maintain, and it looks ugly in code.

What do I want that ExtJs controls will be able to get their value directly from the HTML generated by ASP.NET, and will be able to submit them in a way the controller MVC will understand and will be able to deserialize a model object .

I would also like to use jQuery validation, which is integrated with ASP.NET MVC, and not ExtJS assumptions. Is it possible with ExtJS controls?

Thank you.

Good, because no one answered, I'll tell you what I am doing.

  1. On each input, add a data-type type type, which explains what type of extges control it is called to change.
  2. By using jQuery, get all the input for each input
    1. var container = $ (input) .replaceWith ("& lt; Div style = 'display: inline;' & gt; & lt; / div & gt; ");
    2. Create ExtJS control based on the data-type type, set it to the value of the input. Value, this inputId is Input.id, its name is on input.name You can also convert other properties of source input to ExtJS config item. Specifically, you have to copy all data-val-* attributes, which configure ExtJS's inputAttrTpl by powering the data of MVC input.
    3. Control the Container that you created in step 1 of the loop, rendereto config or .render () function by using.

      Combo box has its own challenges, because its actual value can be verified, it is in the hidden area of ​​the visible input, for the same HTML editor. Goes, but we do not use it.

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -