How to delete a column in dojox/grid/EnhancedGrid - dojox.grid

Do we have any way to delete a column in dojox/grid/EnhancedGrid. Please let us know if there is any solution for this.
Please find my sample grid.
Details: it creates a dojox/grid/EnhancedGrid and has an action associated with clicking a header row. What action can I add to delete the column?
var dataStore = new ObjectStore({objectStore: objectStoreMemory});
// grid
grid = new EnhancedGrid({
selectable: true,
store: dataStore,
structure : [ {
name : "Country",
field : "Country",
width : "150px",
reorderable: false,
editable : true
}, {
name : "Abbreviation",
field : "Abbreviation",
width : "120px",
reorderable: false,
editable : true
}, {
name : "Capital",
field : "Capital",
width : "100%",
reorderable: false,
editable : true
} ],
rowSelector: '20px',
plugins: {
pagination: {
pageSizes: ["10", "25", "50", "100"],
description: true,
sizeSwitch: true,
pageStepper: true,
gotoButton: true,
maxPageStep: 5,
position: "bottom"
}
},
dodblclick: function() {
alert("Header clicked");
}
}, "grid");
grid.startup();

you need to use the method
grid.setStructure(newLayout);
or
grid.set('structure',newLayout);
here newLayout is the layout that you need to create without the columns that you need.
Hope this helps.

Related

MongoDB query that contain at least one of filters specified in an object

I have a collection in MongoDB that is structured like this:
"5d33488672886334cd21904xx": {
"ownerId": "5d333551k99951924fb3208",
"createdAt": 1582456098,
....phone
....email
....etc
"mainActivities": {
"dogWalking": true
},
"secActivities": {
"washing": true,
"houseSitting": true,
"dogSitting": true,
"training": true,
"trainingEquipment": true,
"selectionAdvice": true,
"institutionsBusinesses": true
}
}
"5d33488672886334cd21904xx": {
"ownerId": "5d333d344d46ed924fb3208",
"createdAt": 99999995,
....phone
....email
....etc
"mainActivities": {
"dogWalking": true
},
"secActivities": {
"washing": false,
"houseSitting": false,
"dogSitting": false,
"training": true,
"trainingEquipment": false,
"selectionAdvice": true,
"institutionsBusinesses": true
}
}
i am sending filters from the front end like so :
{
"filters": {
"mainActivities": {
"dogWalking": true
},
"secActivities": {
"washing": false,
"houseSitting": true,
"dogSitting": true,
"training": true,
"trainingEquipment": true,
"selectionAdvice": false,
"institutionsBusinesses": true
}
}
}
i want to get all the documents that answer the filters and not EXACT match .
Example:
if i am a dog walker service named "Xdog" , who give all the 6/6 activities (secActivities)
in the front end , when user select 2/6 filters i miss this "Xdog" service.
i get to a function who return only the document that specify EXACT match and its not good because
i am missing the services who actually answer this 2/6 filters..
right now i am sending and spreading the "filterBy" variable into the find() function .
Any suggestion would be great i am weak in Databases commands.
Sorry for my poor English!
The way to do partial match is with $or, but I don't think that will do what you actually want.
The example query you showed above is looking for dog walking services that do not provide washing or selectionAdvice services. Your description suggests that you do not want to consider these 2 services because the user did not specify them. In that case, leave these 2 out of the query entirely, using the user selections to add only the relevant fields, like:
.find({
"mainActivities": {
"dogWalking": true
},
"secActivities": {
"houseSitting": true,
"dogSitting": true,
"training": true,
"trainingEquipment": true,
"institutionsBusinesses": true
}
}
If the filters object is already built, you would need to remove the properties that are false. See How do I remove a property from a JavaScript object?

Remove checkbox-menu Ag-Grid - VueJs - NodeJs

I need to remove this checkbox from my menu, can anyone help me?
I am using "VueJS".
My current code:
{
headerName: "",
width: 30,
checkboxSelection: true,
suppressMenu: true,
filter: false,
floatingFilterComponentParams: { suppressFilterButton: true }
},
https://prnt.sc/q8d4ci

flot: How to hide multy-yaxes

in my "overview" simple-line-chart, I do not want to display yaxes.
The following code does not help:
yaxes: { show: false, ticks: [] }
It probably works for yaxis, but not for yaxes.
I guess I need to hide each axis, but how do I do it?
The yaxes property needs an array of objects (one for each axis). So, use
yaxis: { show: false, ... }
for one axis and
yaxes: [ { show: false, ... }, { show: false, ... }, ... ]
for multiple axes.

Search is not working with filter toolbar in JQGrid

I am facing issue while loaidng the data in JQGrid at a later stage in place of at the time of ceating grid. I am using filter toolbar for search.
following is the code I am using:
Creating Grid
jQuery("#list").jqGrid({
datatype: 'local',
colNames: [my col names],
colModel: [my col model],
jsonReader: {
root: "rows",
page: "page",
total: "total",
//records: "records",
repeatitems: false
},
height: 300,
viewrecords: true,
gridComplete: this.onGridComplete,
ondblClickRow: this.rowDblClick,
onSelectRow: this.selectRow,
headertitles: false,
loadtext: "Loading...",
sortable: true,
altRows: true,
loadonce: true,
rowNum: 100,
pager: '#pager',
root: "rows",
rowList: [100, 200, 300],
pagination: true,
ignoreCase: true
})
Load data at later stage
if(gridDataStr != "none") // gridDatStr has data
{
grid.initialize(); // create the grid
var myjsongrid = JSON.parse(gridDataStr);
grid.table[0].addJSONData(myjsongrid);
grid.table.jqGrid('setGridParam',{datatype:'json', data:myjsongrid}).trigger('reloadGrid');
if (myjsongrid["rows"].length > 1)
{
grid.table.filterToolbar({
stringResult: true,
searchOnEnter: false
});
}
}
However if I load the same data at the time of creating the grid with datatype:json and using some valid url, searching is working well.
Any suggestions?
The method addJSONData can not be used to work with the jqGrid having the 'local' datatype.
You can use addRowData and to use localReader instead of jsonReader or set data parameter of jqGrid with respect of setGridParam method and then call jQuery("#list")[0].refreshIndex() (see here) and reload the grid.

YUI paginator infinity records in table

I am using YUI for displaying data.
This row is used for set count of records per page:
rowsPerPageOptions : [ 10, 25, 50, 100 ]
Does it have ability to set infinity number of records?
Try just [ 20, 50, 100, 250, 500, 1000, 'all' ]
Resolved using custom page count names and max int.
rowsPerPageOptions : [
{ value : 20, text : '20' },
{ value : 50, text : '50' },
{ value : 100, text : '100' },
{ value : 250, text : '250' },
{ value : 500, text : '500' },
{ value : 1000, text : '1000' },
{ value : 9007199254740992, text : 'All' }],

Resources