1
Suggest new features / Re: select2
« on: October 08, 2024, 07:38:13 pm »
Dear Support,
Please give the sample code for select2.
Thanks
Please give the sample code for select2.
Thanks
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.
{
title: "Edit?",
dataIndx: "IsOnOff",
width: 50,
dataType: "bool",
align: "center",
editor: false,
type: 'checkbox',
editable: true,
cls: "largerCheckbox16NoToggle"
}
{
title: "Edit?",
width: 50,
dataType: "bool",
align: "center",
editor: true,
type: 'checkbox',
editable: true,
cls: "largerCheckbox16NoToggle"
}
var colM =
[
{
title: "Token#",
dataIndx: "stInstrumentToken",
hidden: true,
align: "left",
tpCls: "header-css",
styleHead: {
"font-weight": "bold",
"color": "#fff",
"font-family": "Tahoma",
"background-color": "#666666",
"font-size": "10px"
},
},
{
title: "Series",
dataIndx: "Series",
hidden: true,
align: "left",
tpCls: "header-css",
styleHead: {
"font-weight": "bold",
"color": "#fff",
"font-family": "Tahoma",
"background-color": "#666666",
"font-size": "10px"
},
},
{
title: "",
width: 6,
minWidth: 5,
dataIndx: "Divider1",
editable: false,
sortable: false,
cls: "pq-divider"
},
{
title: "LotSize",
dataIndx: "inLotSize",
hidden: true,
align: "left",
tpCls: "header-css",
styleHead: {
"font-weight": "bold",
"color": "#fff",
"font-family": "Tahoma",
"background-color": "#666666",
"font-size": "10px"
},
},
];
$('body').on('click', '#tabs-filter button', function() {
console.log('Button clicked!');
});
filter: function (event, ui)
{
this.refreshDataAndView();
}
var loGroupModel =
{
on: false,
summaryInTitleRow: 'all',
showSummary: [false], //to display summary at end of every group.
grandSummary: true,
fixCols: false,
indent: 20,
collapsed: [true, true, true],
title: [
"{0} ({1})",
"{0} - {1}"
]
};
var obj =
{
width: "auto",
flex: { one: true },
numberCell: { width: 60, show: false },
resizable: true,
filterModel: { on: true, header: false, type: 'local', menuIcon: true, hideRows: false }, //on: true,
menuIcon: true,
selectionModel: { type: 'row', mode: 'block', column: false },
blur: function (evt, ui) {
mGridUIFocus = ui; //global var
mPrevGridUIFocus = ui; //global var
},
editable: false,
stripeRows: false,
showTitle: false,
hwrap: false,
wrap: false,
strNoRows: 'No Net Position found.',
pageModel: { rPP: 50 },
columnTemplate: {
filter: {
crules: [{ condition: 'contain' }]
}
},
colModel: fsTableHeaders,
groupModel: loGroupModel,
rowInit: function (ui)
{
if (ui.rowData.pq_gtitle)
{
//console.log("pq_gtitle: " + ui.rowData);
return {
style: { "background": "#FAD5A5" }
};
}
},
cellSave: function (evt, ui) {
this.refreshRow({ rowIndx: ui.rowIndx });
},
change: function () {
this.filter();
},
beforeCellClick: function (evt, ui)
{
if (this.SelectRow() != null && this.SelectRow().getSelection() != null) {
if (!evt.ctrlKey && this.SelectRow().isSelected(ui) && this.SelectRow().getSelection().length <= 1) {
return false;
}
}
}
};
var loData = "";
obj.dataModel =
{
method: "GET",
location: "remote",
beforeSend: function (jqXHR, settings) {
jqXHR.setRequestHeader("Content-Type", "application/json");
},
getUrl: function () {
return {
url: "URL to Get net postion data",
data: loData
};
},
getData: function (response) {
var loOrderJS = $.parseJSON(response.d);
data = loOrderJS;
return { data: data }
},
error: function (jqXHR, textStatus, errorThrown) {
customalerterror('Error!', jqXHR.responseText, '500px');
}
};
var grid = pq.grid("#gridfilter1", obj);
grid.one('lazyProgress', function () {
this.flex();
});
grid.on("scroll", function (evt, ui) {
mGridUIScrollX = this.scrollX();
mGridUIScrollY = this.scrollY();
mPrevGridUIScrollX = this.scrollX();
mPrevGridUIScrollY = this.scrollY();
});
grid.on("formatCell", function (row, column, value, data)
{
var groupLevel = this.iGroup.getGroupLevel(row);
if (groupLevel !== undefined && this.iGroup.isSummary(row)) {
var color;
switch (groupLevel) {
case 0:
color = "#FF0000";
break;
case 1:
color = "#FF0000";
break;
case 2:
color = "#FF0000";
break;
default:
color = "#FF0000";
break;
}
return {style: "background-color: " + color};
}
});