PDA

View Full Version : passing data to window



masoud_tamizy
21 Feb 2012, 11:26 PM
how can i pass data to a Window , from a source[store or grid or array] ?

mitchellsimoens
22 Feb 2012, 5:53 AM
What do you mean pass data? Do you have a template specified on the window or do you just need to take action on data?

masoud_tamizy
22 Feb 2012, 6:00 AM
What do you mean pass data? Do you have a template specified on the window or do you just need to take action on data?
thanks for your reply .
i want to pass data to a window when i double click on grid , i.e open a filled window with selected data row .

mitchellsimoens
22 Feb 2012, 6:06 AM
Ok... so if you are going to open a window, set the record as a property of the window when you create it. You will still need to do something in the window to handle the record.

masoud_tamizy
22 Feb 2012, 6:21 AM
please write me a sample code .

You will still need to do something in the window to handle the record.
and how can i handle the record ?

mitchellsimoens
22 Feb 2012, 6:26 AM
Use a template and apply the record.data object to it.

masoud_tamizy
22 Feb 2012, 7:17 AM
Use a template and apply the record.data object to it.
i'm beginner !! please write me a sample :-|

mitchellsimoens
22 Feb 2012, 7:22 AM
I'm not going to sample code, I don't think that is the proper way to teach people. I have given you the way to do it, you just have to implement it. I coach people to find the answers.

masoud_tamizy
22 Feb 2012, 7:35 AM
thanks

friend
22 Feb 2012, 11:37 AM
Other potentially helpful info:

Add an Ext.form.Panel to your Window, where the name attribute of each form field matches a dataIndex field name of your grid's columns. In the Window's afterrender or show event, You can call the Form panel's loadRecord(record) method to load the currently selected grid record.

If the Window is intended for display purposes only, you can set readOnly: true for all of the form's fields.

Visit the API docs for Ext.panel.Form.loadRecord(Ext.data.Model) for more info.