Is there something wrong with floatingFilter in reagent? - ag-grid

I pass floatingFilter as a parameter to agGridReact and setting it to true in defaultColDef but it does not work. Does someone know what is wrong?
:defaultColDef {:sortable true
:editable true
:width deafult-col-w
:filter true
:floatingFilter true}
These are my dependencies:
:dependencies [[org.clojure/clojure "1.9.0"]
[org.clojure/clojurescript "1.10.339"]
[reagent "0.8.1"]
[cljsjs/ag-grid-react "21.0.1-1"]
[cljsjs/ag-grid-community "21.0.1-1"]]
This is the result of my code. Note that I want a row under the columndefinitions, that allows the user to filter.

Related

How to retrieve PACKAGECONFIG variable from another recipe to a bbclass

For one of my requirements, I need to call a specific tasks based on whether a packageconfig variable is defined in another recipes or not.
For example:
We have a recipe called recipes-crypto where, in the .bb file we have:
PACKAGECONFIG[veritysetup] = "--enable-veritysetup,--disable-veritysetup"
BBCLASSEXTEND = "native nativesdk"
Then, in my meta-qti-bsp/classes, I have qimage.class, where I wanted to do like this:
if ${#bb.utils.contains('PACKAGECONFIG', 'veritysetup', 'true', 'false', d)}; then
#Call some function
fi
But it gives errors:
ERROR: ParseError at /local/mnt/workspace/PINTU/WORK/Y2021/NAD-CORE-WORK/NEW_C10_30Nov/poky/meta-qti-bsp/classes/qimage.bbclass:102: unparsed line: 'if ${#bb.utils.contains('PACKAGECONFIG', 'veritysetup', 'true', 'false', d)}; then'
How to make veritysetup variable get recognised in my class file?
I saw some examples and added this on top:
PACKAGECONFIG_append_class-native = " veritysetup"
But with this also it gives the same error.
I am using this veritysetup command only during build time.
So, I wanted to execute this command if and only if this PACKAGECONFIG variable is defined.
What is the best way to do it ?
veritysetup is not a value of PACKAGECONFIG, but it is a flag.
PACKAGECONFIG has many flags and each flag has its value.
For more information about variable flags check this link.
So, here is an example of how to check if that flag is activated:
verity-example.bb
LICENSE = "CLOSED"
PACKAGECONFIG[veritysetup] = "--enable-veritysetup,--disable-veritysetup"
do_check_verity(){
if [ ${#d.getVarFlag('PACKAGECONFIG', 'veritysetup', False)} ]; then
bbwarn "veritysetup is activated with value: ${#d.getVarFlags('PACKAGECONFIG').get('veritysetup')}"
else
bbwarn "veritysetup is not activated."
fi
}
addtask do_check_verity
If you run:
bitbake verity-example -c check_verity
You will get the warning:
WARNING: verity-example-1.0-r0 do_sample: veritysetup is activated
with value: --enable-veritysetup,--disable-veritysetup
Actually, I did it in this way and it worked for me.
The following is already enabled in recipes-crypto like this:
PACKAGECONFIG[veritysetup] = "--enable-veritysetup,--disable-veritysetup"
Now, in our .bbclass I just called like this:
DEPENDS += "cryptsetup-native openssl-native"
PACKAGECONFIG_append = " veritysetup"
**==> This is the main part how we can check, if a packageconfig variable is enabled elsewhere or not**
Then I can check the condition like this:
if not bb.utils.contains('PACKAGECONFIG', 'veritysetup', True, False, d):
//dome something
else:
//done something else

PyMongo : Array filtered positional operator update gives me error

I am trying to run a python code to update a collection with arrays. The below statement give error wtih pymongo . Please guide
db.students.update({}, {'$set': {"grades.$[element]": 100}}, {'multi': true, 'arrayFilters': [{"element": { '$gte': 100}}]} )
tried : multi=True tried : multi:True
I am getting the below error :
common.validate_boolean("upsert", upsert)
File "F:\Program Files\Python3.7\lib\site-packages\pymongo\common.py", line 159, in validate_boolean
raise TypeError("%s must be True or False" % (option,))
TypeError: upsert must be True or False
Pymongo's syntax is a tad different than Mongo's syntax, you should write it like this:
db.students.update({}, {'$set': {"grades.$[element]": 100}}, multi=True, array_filters=[{"element": {'$gte': 100}}])
Also update is deprecated, and in your case you should use update_many instead.
db.students.update_many({}, {'$set': {"grades.$[element]": 100}}, array_filters=[{"element": {'$gte': 100}}])

How to get bourbon-neat to work with Roots

So I'm experimenting with Roots Static Site generator and I'm having a hell of a time getting it to import Bourbon-neat through the app.coffee file.
My app.coffee looks like this:
js_pipeline = require 'js-pipeline'
css_pipeline = require 'css-pipeline'
browserify = require 'roots-browserify'
sass = require 'node-sass'
module.exports =
ignores: ['readme.md', '**/layout.*', '**/_*', '.gitignore', 'ship.*conf']
extensions: [
browserify(files: 'assets/js/main.coffee', out: 'js/build.js')
js_pipeline(files: 'assets/js/*.coffee'),
css_pipeline(files: 'assets/css/*.scss')
]
'coffee-script':
sourcemap: true
jade:
pretty: true
sass:
// includePaths: require('bourbon-neat').includePaths
// includePaths: [require('bourbon-neat').includePaths]
includePaths: ['node_modules/bourbon-neat/app/assets/stylesheets/']
The commented includePaths are other things I've tried. I've read the bourbon-neat docs that mentioned needing to pass require('bourbone-neat').includePaths but it doesn't seem to work.
The error I get when attempting to #import "neat" in my .scss file is:
Error: File to import not found or unreadable: neat.
Note: There doesn't seem to be a tag for root.
For anyone else looking, I was able to get this working. Here's my app.coffee:
js_pipeline = require 'js-pipeline'
css_pipeline = require 'css-pipeline'
browserify = require 'roots-browserify'
module.exports =
debug:true
ignores: ['readme.md', '**/layout.*', '**/_*', '.gitignore', 'ship.*conf']
extensions: [
browserify(files: 'assets/js/main.coffee', out: 'js/build.js')
js_pipeline(files: 'assets/js/*.coffee')
css_pipeline(files: 'assets/css/*.scss')
]
'coffee-script':
sourcemap: true
jade:
pretty: true
scss:
includePaths: require('bourbon-neat').includePaths

Completely lost on getting grails 3.X.X work with mongob

I have been struggling to get grails 3.1.7 to connect to local mongo db. I have implemented various suggestion via main documentation. I have gone through some post on stackoverflow by Alex M and Armarnath
My build.gradle looks like the following:
// ...
compile 'org.grails.plugins:mongodb'
compile "org.mongodb:mongodb-driver:3.0.2"
runtime 'org.springframework.data:spring-data-mongodb:1.8.1.RELEASE'
//compile 'org.mongodb:mongo-java-driver'
//compile("org.grails:gorm-mongodb-spring-boot:5.0.6.RELEASE")
//compile "org.grails.plugins:hibernate"
compile "org.grails.plugins:cache"
//compile "org.hibernate:hibernate-ehcache"
// ...
My application.yml is looking like the snippet below:
//...
environments:
development:
dataSource:
grails:
mongodb:
connectionString: "mongodb://localhost:27017/project-db"
# dbCreate: create-drop
# url: jdbc:h2:mem:devDb;MVCC=TRUE;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE
test:
dataSource:
# dbCreate: update
# url: jdbc:h2:mem:testDb;MVCC=TRUE;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE
production:
dataSource:
# dbCreate: update
# url: jdbc:h2:./prodDb;MVCC=TRUE;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE
# properties:
# jmxEnabled: true
//...
Here is a sample model:
class FlowInfo {
int posIndex
String tagName
Boolean isEnabled
String name
static mapWith="mongo"
static constraints = {
posIndex unique: true
}
}
It looks like I am still getting data pulled from the first initial in memory database created probably at the first run of the seeding from the BootStrap.groovy. Is there a way to make this work. looks like different strategies worked for different people.
thanks for reading this.
I tried it with following configuration in application.yml that worked for me:
environments:
development:
grails:
mongodb:
connectionString: mongodb://localhost:27017/database-name
You might remove dataSource and try once.

whats the best method to test for truthiness in coffeescript

Is it acceptable to just test for "truthy" in coffeescript? I'm looking for a best practice to soak up empty strings in object attributes.
Given:
obj = {
"isNull": null,
"isEmptyString": "",
"isZero": 0
}
## coffeescript
# obj.isNull? === true
# obj.isEmptyString? === false
# obj.isZero? === false
Which is safer or preferable??
# obj.isEmptyString == "truthy"
# !!obj.isEmptyString === true
I believe !! is the accepted method:
obj = {"isNull": null, "isEmptyString": "", "isZero": 0, "isValue": 1}
!!obj.isNull # false
!!obj.isEmptyString # false
!!obj.isZero # false
!!obj.isValue # true
EDIT: Possible duplicate: Easiest way to check if string is null or empty