PDA

View Full Version : Column Locking in Dynamic Grid



BCM
31 Dec 2012, 3:58 AM
Hi,
I have a dynamic grid with dynamic store and model. I want to hide first column of the dynamic grid.
I have set enablelocking : true when defining the grid and
locked:true for the first column.
When I call the Reconfigure() to load the column and data store, the column disappears from the grid.
Since the current column lock state does not matched with the orignal state, the reconfigure method is not able to identify the column and its not displaying the first column.
I found a example which uses Ext.ux.LockedColumnModel and LockedGridView, but non of these options are available with EXT 4.

pls let me know if any idea on achieving locking on dynamic grid!!

mitchellsimoens
2 Jan 2013, 8:23 AM
It should just show the columns you pass in. Maybe I'm not understanding what you are saying.

BCM
2 Jan 2013, 7:44 PM
Hi Mitchell,
Thanks for responding my issue.

I have created a dynamic grid with dynamic model and dynamic store. It's displaying perfectly. The way the code desinged is,
1. Defined a gridpanel with initComponent ,render and storeload functions.
[*=1]initcomponent has columns = []. Which means its an empty grid with no columns.[*=1]OnRender, it'll call functions to load the store and render the gridview.[*=1]Storeload function gets the json response with all the grouped columns and fields. First column of the Json response had locked: true
[*=1]function sets the model with json fields.[*=1]Reconfigured the grid with datastore and json columns.[*=1]store loaded and grid view refreshed.

2. Defined a dynamic model
3. Defined a dynamic store.
4. Created a new gridpanel from the above defined gridpanel and defined store.

When I run the code, my fist column is not deplayed at all. If I remove the locked: true status for the first column, its getting displayed on the screen. There is something related to locked status and reconfiguration method. As it is completely dynamic formation with reconfiguration method, locking the column on runtime is not displaying the column.

If my explanation is not understandable, please let me know. I need someway to sort this issue. Its like clueless for quite few days. how come this be impossible?








It should just show the columns you pass in. Maybe I'm not understanding what you are saying.

BCM
2 Jan 2013, 8:46 PM
Hi Mitchell,
Thanks for responding my issue.

I have created a dynamic grid with dynamic model and dynamic store. It's displaying perfectly. The way the code desinged is,
1. Defined a gridpanel with initComponent ,render and storeload functions.
[*=1]initcomponent has columns = []. Which means its an empty grid with no columns.[*=1]OnRender, it'll call functions to load the store and render the gridview.[*=1]Storeload function gets the json response with all the grouped columns and fields. First column of the Json response had locked: true
[*=1]function sets the model with json fields.[*=1]Reconfigured the grid with datastore and json columns.[*=1]store loaded and grid view refreshed.

2. Defined a dynamic model
3. Defined a dynamic store.
4. Created a new gridpanel from the above defined gridpanel and defined store.

When I run the code, my fist column is not deplayed at all. If I remove the locked: true status for the first column, its getting displayed on the screen. There is something related to locked status and reconfiguration method. As it is completely dynamic formation with reconfiguration method, locking the column on runtime is not displaying the column.

If my explanation is not understandable, please let me know. I need someway to sort this issue. Its like clueless for quite few days. how come this be impossible?








It should just show the columns you pass in. Maybe I'm not understanding what you are saying.

elcooleperco
16 Sep 2013, 6:19 AM
I have found workaround

by default i create empty store and declare columns as

columns: [{
text: '',
locked: true,
width: 150,
sortable: true,
dataIndex: 'blah'
}, {
text: '',
locked: false,
width: 150,
sortable: true,
dataIndex: 'blah2'
}]


after this i perform

grid.reconfigure(new store, new grid_columns);
and grid render normally except that width of locked grid column not changed to grid_columns[0].width,
its remain 150 as first column definition =(
any Ideas?

kamleshmoliya@yahoo.com
9 Apr 2016, 1:49 PM
Any update on this? Why we are not able to get columns in this case?