1
Help for ParamQuery Grid (free version) / Re: the Issue on "this.replace" function cannot find
« on: February 03, 2016, 01:57:46 pm »
Please see the attachment
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
"editable" works for checkbox editors too. Check this demo (column "Discontinued") http://paramquery.com/pro/demos/editing
{ title: "Ready for review", dataIndx: "state", maxWidth: 50, minWidth: 50, align: "center", cls:'checkReadForReview',
cb: { header: true, all: false },
type: 'checkBoxSelection', resizable: false, sortable: false,
editable: false,
}
render: function (ui){
var rowData = ui.rowData, dataIndx = ui.dataIndx;
var val = rowData[dataIndx];
if(val == 'total'){
return '';
}
else{
var currentId = rowData['Id']+'PMM';
var currentStatus = rowData['status'];
str = "";
if (val) {
str = "checked='checked'";
}
var validatedValue = rowData['validatedandLocked'];
if(isPriceAnalyst == 'true'){
if(String(validatedValue) == 'true' && {!(isUnlocked)}){
reStr = "<input id='"+currentId+"' type='checkbox' " + str + " onclick='pmmDoneCheck(\""+currentId+"\")' />";
}
else{
reStr = "<input id='"+currentId+"' type='checkbox' " + str + " disabled='true' />";
}
return reStr;
}
else{
return "<input id='"+currentId+"' type='checkbox' " + str + " disabled='true' />";
}
}
}
Any change to the grid DOM should be done in refresh event.Code: [Select]refresh: function(){
$(this).find(".pq-grid-title-row input[type='checkbox']").wrap("<span>Title</span>");
},
{ title: "", dataIndx: "state", maxWidth: 30, minWidth: 30, align: "center", cls:'checkReadForReview',
cb: { header: true, all: false },
type: 'checkBoxSelection', resizable: false, sortable: false, editable: false
}
$("td[pq-col-indx=126][pq-row-indx=0]").append('<div class="pq-td-div">Ready For Review<span class="pq-col-sort-icon"> </span></div>');
It seems some of your columns are uneditable but you want to persist all field values passed in addRow.
You could pass checkEditable: false to addRow method.
http://paramquery.com/pro/api#method-addRow
I've submitted it for further examination.
Meanwhile you can use getRowData() method to get rowData from rowIndx.
http://paramquery.com/pro/api#method-getRowData
Noctrona
ui.rowData is present in column.editable for 2.4.1
It's used in this demo http://paramquery.com/pro/demos/readonly_cells and it's the same code for 2.4.1
Are you facing this issue for all columns.
$("#addColumn").click(function(){
var DM = $( "#grid_json" ).pqGrid( "option", "dataModel" );
if(typeof(DM.data) != "undefined"){
var rows = DM.data.length;
var rowData = { Id:'',productId:'',product:'',
basicMaterial:'', MissingDataMessage : '',status:'',
volume:0,startDate: sDate,endDate:eDate,accessoryId:'',
volumeEdit:false,cosEdit:false
};
$( "#grid_json" ).pqGrid("addRow", { rowIndxPage: rows+1, rowData: rowData });
if(isPriceAnalyst != 'true'){
$("#grid_json").pqGrid("addClass", { rowIndx: rows, dataIndx: 'costOfSalesUnit', cls: 'unEdit-pq-col' });
}
}
if(sforce.console.isInConsole()) {
sforce.console.setTabUnsavedChanges(true, undefined);
editSign = true;
}
});
Hi team,
I have a problem want to confirm.
Please have a look with my codes:Code: [Select]{ title: "Product", dataIndx: "product",width: 130,
editor: {
type: "select", options: productArray,style: 'width:230px;'
},
render: function (ui) {
//return (ui.cellData.split(':')[0]);
if(ui.cellData == '' || ui.cellData == null){
return '';
}
else{
return (ui.cellData == '' ? '' : ui.cellData.split(':')[0]);
}
},
editable: function(ui){
var rowIndx=ui.rowIndx;
[b]var status = ui.rowData['status'];[/b]
if(status == 'SPR Counter Offer'){
return false;
}
else{
return true;
}
}
}
I have another column which index is "status". In previous version(2.1.0) I can get the status value by "ui.rowData['status']". But now when I test it with new version(2.4.1) the "ui.rowData" is undefined. But I can use this in render function.
Is there have any problem with my codes?
Thank you!
<link rel="stylesheet" href="{!URLFOR($Resource.jqueryPPP, 'jquery-ui.css')}" />
<script src="{!URLFOR($Resource.jqueryPPP, 'jquery.min.js')}"></script>
<script src="{!URLFOR($Resource.jqueryPPP, 'jquery-ui.min.js')}"></script>
<script src="/support/console/32.0/integration.js" type="text/javascript"></script>
<!--ParamQuery Grid files-->
<link rel="stylesheet" href="{!URLFOR($Resource.paramQuery241, 'pqgrid.min.css')}" />
<!--<link rel="stylesheet" href="{!URLFOR($Resource.paramQuery241, 'pqSelect/pqselect.min.css')}" />-->
<script src="{!URLFOR($Resource.paramQuery241, 'pqgrid.min.js')}"></script>
<!--<script src="{!URLFOR($Resource.paramQuery241, 'pqSelect/pqselect.min.js')}"></script>-->
{ title: "Product", dataIndx: "product",width: 130,
editor: {
type: "select", options: productArray,style: 'width:230px;'
},
render: function (ui) {
//return (ui.cellData.split(':')[0]);
if(ui.cellData == '' || ui.cellData == null){
return '';
}
else{
return (ui.cellData == '' ? '' : ui.cellData.split(':')[0]);
}
},
editable: function(ui){
var rowIndx=ui.rowIndx;
[b]var status = ui.rowData['status'];[/b]
if(status == 'SPR Counter Offer'){
return false;
}
else{
return true;
}
}
}
Class of grid header cell can be combined with it to make the rule applicable to grid header cell only.
.pq-grid-col[pq-col-indx="11"]{
background-color: #8B008B;
color: white;
}
[pq-grid-col-indx="11"]{
background-color: #8B008B;
color: white;
}
Hello noctrona
Yes you can still add comments to the cell.
commentRender is only used to show a small comments icon in the cell which acts as an indicator that the cell has comments, it's not mandatory for comments functionality.
{ title: "Line Item Status", width: 64,align: "center",editable: false,dataIndx: "status", render: goPR }
"goPR" is one js method.