PDA

View Full Version : javascript in view data



erenault
21 Jul 2008, 2:23 AM
Hi,

I almost the same problem (http://extjs.com/forum/showthread.php?t=41343)
but it's for the data of the view.
The view doesn't display the data if the data is <script> getLabel('key1')</script> for example

The view display only the name of the column if used this


listeners: {
'beforeRender':{
fn: function(){
this.store.on( 'load', function(){
this.store.each(function(record) {
alert(record.id); // display id of row
record.fields.each(function(field){
alert(record.get(field.name)); //display name of column
});
});
}, this)
}
}
}


If I use "alert(record.get(field.getValues())); ", I've got [object Object] !!!

I would like to display the data of the column before load ?

Could someone help me ?
Thanks for avance

jratcliff
22 Jul 2008, 12:33 PM
Hi,

I almost the same problem (http://extjs.com/forum/showthread.php?t=41343)
but it's for the data of the view.
The view doesn't display the data if the data is <script> getLabel('key1')</script> for example

The view display only the name of the column if used this


If I use "alert(record.get(field.getValues())); ", I've got [object Object] !!!

I would like to display the data of the column before load ?

Could someone help me ?
Thanks for avance

Well, not sure how we can handle this in the current beta. However, you'll be excited to learn that the next beta will include the ability to allow a developer to define custom renderers for columns. I believe that a custom rendering will do what you need.

In the meantime, I'll see what we can do as a temporary quick solution. By the way, what does getValues() do? Can you post that code?

erenault
22 Jul 2008, 11:05 PM
Well, not sure how we can handle this in the current beta. However, you'll be excited to learn that the next beta will include the ability to allow a developer to define custom renderers for columns. I believe that a custom rendering will do what you need.

In the meantime, I'll see what we can do as a temporary quick solution. By the way, what does getValues() do? Can you post that code?

Here my code :


listeners: {
'beforeRender':{
fn: function(){
this.store.on( 'load', function(){
this.store.each(function(record) alert(record.id); //display the number of row record.fields.each(function(field){
record.fields.each(function(fields){
fieldValue= field.name;
alert(field.name); // display the name of column at each row it's ok
var fieldValue = record.get(field.name);
// alert(record.get(field.name)); // I would like to see the value of all cells
// alert(record.get(field.getValue()); // display [object Object]


Sorry, it was getValue() of object 'Field' :">


Thanks for advance.
PS : do you have a date for the next beta ?