jQuery UI Widgets › Forums › Grid › paste only number instead string
Tagged: columntype, copy, grid, jqxgrid, multiplecellsadvanced, paste, selectionmode, string, textbox, value
This topic contains 3 replies, has 2 voices, and was last updated by aldo86 10 years, 2 months ago.
-
Author
-
Hi,
I’ve configured the grid with selectionmode: ‘multiplecellsadvanced’ and the columns in this way columntype: ‘textbox’ but copy/paste function paste only number.Best regards
Hello aldo86,
We cannot reproduce this issue. Please open the demo Spreadsheet and try copying/pasting text values.
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/Hi Dimitar,
this is my code, can you see something wrong?var datafields = [];
if(cfg.headersVals) {
_this.headersVals = cfg.headersVals;
}jQuery.each(_this.headersVals, function(index, value) {
datafields.push({name: index, type:’text’});
});// prepare the data
var data = [];for (var i = 0; i < 100; i++) {
var row = [];
jQuery.each(_this.headersVals, function(index, value) {
row.push({index : ”});
});
data.push({ i : row });
}_this.source =
{
localdata: data,
datafields: datafields,
datatype: “json”,
url: null
};
_this.dataAdapter = new $.jqx.dataAdapter(_this.source);_this.dropdownH = [“-“];
var columnsH = [];jQuery.each(_this.headersVals, function(i, val) {
_this.dropdownH.push(val);
columnsH.push({ text: val, datafield: i, columntype: ‘textbox’, cellsrenderer: _this.cellsrenderer,
renderer: function(){},
width: ($(‘#dgrid_def_fields’).get(0).checked == true ? _this.defWidths[i] : _this.allWidths[i]), cellsformat: ‘f’ });});
$(“#jqxgrid”).jqxTooltip();
$(“#jqxgrid”).jqxGrid(
{
theme: ‘energyblue’,
width: ‘100%’,
height: ‘100%’,
source: _this.dataAdapter,
enabletooltips: true,
editable: true,
altrows: true,
selectionmode: ‘multiplecellsadvanced’,
columnsresize: true,
cellhover: function (element, pageX, pageY)
{if($(element.innerHTML).attr(“data-title”)){
// update tooltip.
$(“#jqxgrid”).jqxTooltip({ content: $(element.innerHTML).attr(“data-title”), width: 400 });
// open tooltip.
$(“#jqxgrid”).jqxTooltip(‘open’, pageX + 15, pageY + 15);
}else{
$(“#jqxgrid”).jqxTooltip(‘close’);
}
},
columns: columnsH,
showemptyrow: false,
ready: function(){var i=0;
var selInd=0;
$(“.columnH”).each(function(){
i++;
if(i>=_this.dropdownH.length)
selInd = 0;
else selInd = i;$(this).jqxDropDownList({ source: _this.dropdownH, selectedIndex: selInd, width: ($(‘#dgrid_def_fields’).get(0).checked == true ? _this.defWidths[i] : _this.allWidths[i]), height: ’25’, theme: ‘energyblue’});
});
$(“.columnH”).unbind(‘change’);
$(“.columnH”).on(‘change’, function (event){
var idDD=$(this).attr(“data-id”);
$(“.columnH”).each(function(){
if(idDD!=$(this).attr(“data-id”)){
if($(“.columnH[data-id=”+idDD+”]”).jqxDropDownList(‘getSelectedItem’).label==$(this).jqxDropDownList(‘getSelectedItem’).label)
$(this).jqxDropDownList(‘selectIndex’, 0 );
}
});
});$.oDialog.trigger(“dialogresize”);
}
});Well the problem was: cellsformat: âfâ.
-
AuthorPosts
You must be logged in to reply to this topic.