-
14 Jan 2010 7:31 AM #1
Copy and paste in grid columns and rows
Copy and paste in grid columns and rows
Hi guys,
I'm very new with EXT JS Grid and I'm working with a grid that has chechkbox and text data, the problem is that the user cant select rows or columns to copy the data. Is there a way this could be done?
This is the way Im creating some of the columns:
'detail' => array (
'#sortable' => self::COL_SORTABLE_ITEM_NUMBER,
'#hideable' => self::COL_HIDEABLE_ITEM_NUMBER,
'#width' => self::COL_WIDTH_PRIMARY_ZIP,
),
'item_number' => array (
'#sortable' => self::COL_SORTABLE_ITEM_NUMBER,
'#hideable' => self::COL_HIDEABLE_ITEM_NUMBER,
'#width' => self::COL_WIDTH_ITEM_NUMBER,
),
'item_head' => array (
'#sortable' => self::COL_SORTABLE_ITEM_NUMBER,
'#hideable' => self::COL_HIDEABLE_ITEM_NUMBER,
'#width' => self::COL_WIDTH_ITEM_HEAD,
),
Is there a property to change to allow this option?
Regards
Esteban
-
14 Jan 2010 8:25 AM #2Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- Frederick MD, NYC, DC
- Posts
- 16,169
- Vote Rating
- 28
Dude, what framework are you using? That's PHP, not JavaScript

Jay Garcia @ModusJesus || Modus Create co-founder
Ext JS in Action author
Sencha Touch in Action author
Get in touch for Ext JS & Sencha Touch Touch Training
We are also working on Video-based Sencha Touch training: Check it out here.
-
14 Jan 2010 8:33 AM #3
That's Drupal :P ... sorry I paste the wrong code
This is the JS code:
Ext.onReady(function(){var xg = Ext.grid;var reader = new Ext.data.ArrayReader({},$js_fields);
var txtIds = ',' + '$disabled_checkbox' + ',';
var sm = new xg.CheckboxSelectionModel({checkOnly: true,
renderer: function(value, metaData, record) {
// Hide checkbox for certain records
var indexId = record.get('index_id');
if (txtIds.indexOf(',' + indexId + ',') > -1) {
return '';
}
//return '<div class="x-grid3-row-checker"> </div>';
return Ext.grid.CheckboxSelectionModel.prototype.renderer.apply(this, arguments);
}
});var grid2 = new xg.GridPanel({
store: new Ext.data.Store({
reader: reader,
data: xg.dummyData
}),
cm: new xg.ColumnModel({
defaults: {
width: 120,
sortable: true
},
columns:$js_columns
}),
sm: sm,
columnLines: true,
width:$table_width,
height: $table_height,
frame: false,
singleSelect: true,
renderTo: 'editor-grid'
});
-
14 Jan 2010 8:37 AM #4Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- Frederick MD, NYC, DC
- Posts
- 16,169
- Vote Rating
- 28
Please use CODE tags in the future!

Jay Garcia @ModusJesus || Modus Create co-founder
Ext JS in Action author
Sencha Touch in Action author
Get in touch for Ext JS & Sencha Touch Touch Training
We are also working on Video-based Sencha Touch training: Check it out here.
-
14 Jan 2010 8:37 AM #5Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- Frederick MD, NYC, DC
- Posts
- 16,169
- Vote Rating
- 28
Do you want them to be able to select Text from the grid?

Jay Garcia @ModusJesus || Modus Create co-founder
Ext JS in Action author
Sencha Touch in Action author
Get in touch for Ext JS & Sencha Touch Touch Training
We are also working on Video-based Sencha Touch training: Check it out here.
-
14 Jan 2010 8:40 AM #6
Yes, the idea is that the users can copy and paste the data that is in every cell.
-
14 Jan 2010 8:46 AM #7Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- Frederick MD, NYC, DC
- Posts
- 16,169
- Vote Rating
- 28
so you want to be able to copy "rows" of data?
I'm confused as to what the requirements are. Where are they copying to?
Either way, what you're looking for is not out of the box. You'll need to work at it.
Jay Garcia @ModusJesus || Modus Create co-founder
Ext JS in Action author
Sencha Touch in Action author
Get in touch for Ext JS & Sencha Touch Touch Training
We are also working on Video-based Sencha Touch training: Check it out here.
-
14 Jan 2010 8:56 AM #8
I need to copy columns or rows of data just like you copy and paste from an excel doc to a text pad.
-
14 Jan 2010 8:58 AM #9Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- Frederick MD, NYC, DC
- Posts
- 16,169
- Vote Rating
- 28
It's not that simple! You can't post to the clipboard with JavaScript.

Jay Garcia @ModusJesus || Modus Create co-founder
Ext JS in Action author
Sencha Touch in Action author
Get in touch for Ext JS & Sencha Touch Touch Training
We are also working on Video-based Sencha Touch training: Check it out here.
-
14 Jan 2010 9:18 AM #10
Yeah, although the grid looks like a spreadsheet - it's actually just a bunch of css and javascript wrapped around your data. Your cursor has no idea how to select the rows + columns. You will have to look into some kind of "export" method to export the data as a spreadsheet, or .csv.
md


Reply With Quote