jQuery UI Widgets › Forums › Grid › How to copy text of rows in jqxgrid while making it remain uneditable?
This topic contains 18 replies, has 9 voices, and was last updated by Dimitar 7 years, 10 months ago.
-
Author
-
August 18, 2014 at 12:07 pm How to copy text of rows in jqxgrid while making it remain uneditable? #58475
I am using jqxgrid for my application.I want to copy text of a row in jqxgrid (to use it for search etc) but the text should remain uneditable also(ie read only).I got some properties of jqxgrid but using them the text is also becoming editable in addition to copyable.Can someone please suggest me any solution for this??
August 18, 2014 at 12:36 pm How to copy text of rows in jqxgrid while making it remain uneditable? #58476If I understand properly, you can it adjusting your grid’s editable property is false and selectionMode property is singlecell.
Then, you can write your codes into the cellselect event to copy, get or another purposes that you want..August 18, 2014 at 12:38 pm How to copy text of rows in jqxgrid while making it remain uneditable? #58477Hello jain vardhman,
You can have both options enabled, e.g. in the demo Default Functionality select a cell and press Ctrl+C to put the cell’s value in the clipboard.
Another option is to set enablebrowserselection to true. Make sure that editmode is not set to “click”, though.
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/January 21, 2015 at 10:26 am How to copy text of rows in jqxgrid while making it remain uneditable? #65737Hi,
I have problem with CTRL+C like any others.I want to copy the value of a cell to clipboard with ctrl+c. I don’t want to make the value editable so the option is out. I have set enablebrowserselection to true. my editmode is already set on “checkbox” so I can’t change it to click or dblclick and so on. Please give me a solution to enable the clipboard.
Regards,
SadeghJanuary 21, 2015 at 10:28 am How to copy text of rows in jqxgrid while making it remain uneditable? #65738Hi Sadegh,
Clipboard is enabled by default and Ctrl+C works when you have selection. We don’t find any issues with the Clipboard behavior. If you wish, check out our online demos.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comJanuary 21, 2015 at 10:42 am How to copy text of rows in jqxgrid while making it remain uneditable? #65740Hi Peter,
Thanks for your prompt response. can you please test the following script for me is from your website’s demos.
`$(document).ready(function () {
var url = “../sampledata/products.xml”;// prepare the data
var source =
{
datatype: “xml”,
datafields: [
{ name: ‘ProductName’, type: ‘string’ },
{ name: ‘QuantityPerUnit’, type: ‘int’ },
{ name: ‘UnitPrice’, type: ‘float’ },
{ name: ‘UnitsInStock’, type: ‘float’ },
{ name: ‘Discontinued’, type: ‘bool’ }
],
root: “Products”,
record: “Product”,
id: ‘ProductID’,
url: url
};var cellsrenderer = function (row, columnfield, value, defaulthtml, columnproperties, rowdata) {
if (value < 20) {
return ‘<span style=”margin: 4px; float: ‘ + columnproperties.cellsalign + ‘; color: #ff0000;”>’ + value + ‘</span>’;
}
else {
return ‘<span style=”margin: 4px; float: ‘ + columnproperties.cellsalign + ‘; color: #008000;”>’ + value + ‘</span>’;
}
}var dataAdapter = new $.jqx.dataAdapter(source, {
downloadComplete: function (data, status, xhr) { },
loadComplete: function (data) { },
loadError: function (xhr, status, error) { }
});// initialize jqxGrid
$(“#jqxgrid”).jqxGrid(
{
width: 850,
source: dataAdapter,
pageable: true,
autoheight: true,
sortable: true,
altrows: true,
enabletooltips: true,
//editable: true,
selectionmode: ‘checkbox’,
columns: [
{ text: ‘Product Name’, columngroup: ‘ProductDetails’, datafield: ‘ProductName’, width: 250 },
{ text: ‘Quantity per Unit’, columngroup: ‘ProductDetails’, datafield: ‘QuantityPerUnit’, cellsalign: ‘right’, align: ‘right’, width: 200 },
{ text: ‘Unit Price’, columngroup: ‘ProductDetails’, datafield: ‘UnitPrice’, align: ‘right’, cellsalign: ‘right’, cellsformat: ‘c2’, width: 200 },
{ text: ‘Units In Stock’, datafield: ‘UnitsInStock’, cellsalign: ‘right’, cellsrenderer: cellsrenderer, width: 100 },
{ text: ‘Discontinued’, columntype: ‘checkbox’, datafield: ‘Discontinued’ }
],
columngroups: [
{ text: ‘Product Details’, align: ‘center’, name: ‘ProductDetails’ }
]
});
});January 21, 2015 at 10:49 am How to copy text of rows in jqxgrid while making it remain uneditable? #65741Hi Sadegh,
You may try this out: http://www.jqwidgets.com/jquery-widgets-demo/demos/jqxgrid/defaultfunctionality.htm?arctic
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comJanuary 21, 2015 at 10:58 am How to copy text of rows in jqxgrid while making it remain uneditable? #65742Hi,
This one is editable, as I mentioned I don’t want the value be editable.
Thanks,
SadeghJanuary 21, 2015 at 11:09 am How to copy text of rows in jqxgrid while making it remain uneditable? #65743Hi Sadegh,
It does not matter whether it’s editable or not. Pressing Ctrl+C copies Grid selection to the Clipboard.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comJanuary 21, 2015 at 12:42 pm How to copy text of rows in jqxgrid while making it remain uneditable? #65756Hi Peter,
But I think it matters because if you turn off the editable, you won’t be able to check the checkboxes.
Regards,
SadeghApril 16, 2015 at 7:11 am How to copy text of rows in jqxgrid while making it remain uneditable? #69939Hi,
Please check the following example to see what we mean – http://jsfiddle.net/Dp5tA/44/
You will not be able to select the text using a CTRL+C, it only works if you right click and copy.
Using Chrome.
—
Sampath Kumar G
Osmosys Software Solutions.April 16, 2015 at 7:39 am How to copy text of rows in jqxgrid while making it remain uneditable? #69941In the previous example, it will select the whole row when we want to only select a cell’s value. If
selectionmode
is set tocheckbox
, even that doesn’t happen. Check this – http://jsfiddle.net/Dp5tA/46/This happens when pressing Ctrl + C.
—
Sampath Kumar G
Osmosys Software Solutions.April 16, 2015 at 8:14 am How to copy text of rows in jqxgrid while making it remain uneditable? #69946Hi SampathG9,
Ctrl+C copies what’s selected in the Grid to the Clipboard. I verified that this works correctly.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comApril 16, 2015 at 10:22 am How to copy text of rows in jqxgrid while making it remain uneditable? #69950Peter,
I’m talking about highlighting and then copying an individual cell’s value. When I select a row and press cntrl + C, it does copy, but it copies the whole row.
April 16, 2015 at 11:23 am How to copy text of rows in jqxgrid while making it remain uneditable? #69955Hi SampathG9,
If it’s row selection, you can’t Copy just a Cell. If it’s cell selection, you can copy a Cell. Highlighting and Selecting are different things. You can’t copy a cell value by just highlighting/hovering a cell.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com -
AuthorPosts
You must be logged in to reply to this topic.