PDA

View Full Version : binding data to grid in extjs 4.2



y0uzha
22 Jun 2015, 6:21 PM
hi i want to make some grid with binding data like this example.

https://fiddle.sencha.com/#fiddle/lcv

but why when i try it using extjs 4.2. it was doesn't work. is this not possible to do this in extjs 4.2 . pls help me.

here is my fiddle

http://jsfiddle.net/y0uzha/2ts1v0v7/

evant
22 Jun 2015, 6:53 PM
Viewmodels and view controllers weren't added until Ext 5.

y0uzha
22 Jun 2015, 6:55 PM
is there any other way for me to do this with extjs 4 version.?

jdkhamba
23 Jun 2015, 5:30 AM
You are probably looking for something like this :

http://docs.sencha.com/extjs/4.2.0/#!/example/grid/binding.html

Except, instead of plain text, you need to be able to bind the data to an Ext textfield.
There is a very twisted way of doing that. You can use a dataview (Ext.view.View) and bind a store to it. The template of that view would be just a table with the with the correct number of rows and columns based on the store data. Then on the refresh event of the view, and ext textfield could be rendered in the right location (renderTo) and populate it with the correct value from the selected row in the grid. Based on the selected record in the grid, the view's store could be filtered so that the right data displays.