PDA

View Full Version : ExtGrid: Multiline Cell possible?



insnet
8 Mar 2008, 4:51 AM
Hi,
is it possible to make a cell multiline with auto wrap-text etc.? Just like a normal html-table?

I could not find any hinds in the ExtJS-API.

Condor
8 Mar 2008, 5:28 AM
Try adding:


.x-grid3-cell-inner {white-space:normal;}

insnet
8 Mar 2008, 5:34 AM
Try adding:


.x-grid3-cell-inner {white-space:normal;}

how do i add this to my column?


{header: 'Description', css: '.x-grid3-cell-inner {white-space:normal;}', dataIndex: 'worksheet[description]'}

Condor
8 Mar 2008, 5:47 AM
Did you want this only for 1 column?

Use:


{header: 'Description', id: 'description', dataIndex: 'worksheet[description]'}

with


<style type="text/css">
.x-grid3-td-description .x-grid3-cell-inner {white-space:normal;}
</style>

insnet
8 Mar 2008, 5:52 AM
nice! you saved my day.

Nisse
11 Mar 2008, 10:38 AM
Great Thanks, you saved my day too!

baskar
26 Apr 2009, 10:41 PM
Great Thanks, you saved my day too!

hi

i am new in extjs,

This is My Description value= "This first line text
this second line text
this third line text"


how can i display this value in my grid cell?

anybody help me?

regards
baskar

Condor
27 Apr 2009, 1:16 AM
The text is HTML, so you need to insert <br /> tags between the lines (or use the Ext.util.Format.nl2br function).

baskar
27 Apr 2009, 2:34 AM
The text is HTML, so you need to insert <br /> tags between the lines (or use the Ext.util.Format.nl2br function).

Hi
Thank for replay me

I don't know how can i use the Ext.util.Format.nl2br formet

can you help me

Condor
27 Apr 2009, 3:06 AM
Can you post the code you are currently using?

baskar
27 Apr 2009, 4:53 AM
Can you post the code you are currently using?





This is my code


Record Set:

var registerrecords = Ext.data.Record.create([
{name: 'advertisement_text',type:'string'}

]);


This is CM:
{
header:'Advertisement',
id:'advertisement_text',
dataIndex:'advertisement_text',
renderer:description
},



This is renderer function

function description(val)
{
var desc=Ext.util.format.nl2br(val);
return desc;
}


I am using this code only,
can you replay me

Condor
27 Apr 2009, 5:30 AM
It's:

Ext.util.Format.nl2br(val);

baskar
27 Apr 2009, 5:59 AM
It's:

Ext.util.Format.nl2br(val);

hi

sorry for disturbing you,

I change that coding, Again that is not working can you give me any other things

Modified coding;

renderer Function is:
function description(val)
{
var desc=Ext.util.Format.nl2br(val);
return desc;
}

CM is:{
header:'Advertisement',
id:'advertisement_text',
dataIndex:'advertisement_text',
renderer:description
}

can you help me

Condor
27 Apr 2009, 6:02 AM
Define 'not working'. It displays fine for me.

baskar
27 Apr 2009, 10:38 PM
Can you post the code you are currently using?

hi

i changed that code,But again the code is not working,

this is that code


CM is:
{
header:'Advertisement',
id:'advertisement_text',
dataIndex:'advertisement_text',
renderer:description
},

This is Renderer method
function description(val)
{
var desc=Ext.util.Format.nl2br(val);
return desc;
}


And This is my store

var mediaEnquiryModelStore = new Ext.data.GroupingStore({
id:'registerStore',
url: 'get_newspaper_ads.php',
autoLoad:true,
reader:new Ext.data.ArrayReader({},registerrecords),
sortInfo:{field: 'publication', direction: "ASC"},groupField:'publication'});

The mozilla firefox bug show store get_newspaper_ads.php database value
like this

[["1","The Hindu","","Test ad","2009-04-30","Direct Bank Deposit","","This is description field multiline value
in database table
this is not render to js records fields
hgfhfhfh","Brightson","[email protected]","9884025613","Classified Mart(Except Chennai)","Thiruvananthapuram"
,"79 (including space)","0.00"]]

but this value not renderer
the js fields

can you help me
thanks

baskar
28 Apr 2009, 9:23 PM
hi
i am expacting your answer? About multiline in grid cell possible?

Condor
29 Apr 2009, 12:07 AM
Can you check which character is used to mark a new line in the JSON data (is it actually a \n character)?