How can I get a jQgrid without editing and having select search elements as like:
http://www.ok-soft-gmbh.com/jqGrid/ToolbarSearchValidation.htm
I think the demo that you've linked to is using jqGrid's filterToolbar feature:
see: http://www.trirand.com/jqgridwiki/doku.php?id=wiki:toolbar_searching
Here is how I solved:
stype: "select", searchoptions: { sopt: ['eq', 'ne'], value: ":All;true:Yes;false:No"
Related
So I'm trying to implement postgresql full text search through Sequelize 3 but there're a few problems including that, I couldn't add text search functions in current where clause:
where: {
published: true,
and: where(
fn("tsmatch",
col("tokens"),
fn("plainto_tsquery", query),
),
true,
)
},
I know we can use raw sql statement but the problem is that existing implementation is based on Sequelize operators and that's what Sequelize recommends for security.
Found a good resource for adding and reusing a function for it here but am stuck in combining it with other query params.
Ok, I've ended up using where clause again:
where: {
published: true,
where: where(
fn("tsmatch",
col("textTokens"),
fn("plainto_tsquery", text),
),
true,
)
},
Hope this would help others facing similar issue.
Sequelize version 6.5.0+ supports the TSVECTOR datatype and Op.match:
Model.findAll({
where: {
textTokens: { [Op.match]: sequelize.fn('to_tsquery', query) }
}
})
i have a combobox in EXT version 7 code. I have the editable config as true. My code is as below. This code is similar to what is present in the sencha docs. I have just changed the editable config to true . When we type anything in textfield it appends random characters and the search does not work as expected. Is it a bug with Ext 7? I am not able to figure out. Is someone else also facing something similar?
Ext.create({
fullscreen: true,
xtype: 'container',
padding: 50,
layout: 'vbox',
items: [{
xtype: 'combobox',
label: 'Choose State',
queryMode: 'local',
displayField: 'name',
valueField: 'abbr',
// For the dropdown list
itemTpl: '<span role="option" class="x-boundlist-item">{abbr} - {name}</span>',
// For the content of the text field
displayTpl: '{abbr} - {name}',
editable: true,
store: [
{ abbr: 'AL', name: 'Alabama' },
{ abbr: 'AK', name: 'Alaska' },
{ abbr: 'AZ', name: 'Arizona' }
]
}]
});```
I have the same problem with the combobox component in the modern toolkit. I tried the same setup in the Ext JS Version 6.5 and the same error occured.
The only workaround I found for now was to not use the displayTpl config.
Then it worked as intended.
EDIT:
I debugged a little bit into the ext-modern-all and found a solution.
If you want to be able to edit the input field as well as to use the displayTpl you have to set forceSelection: true. Otherwise it will treat your entry as new record and this bug will occur. (https://docs.sencha.com/extjs/7.0.0/modern/Ext.field.ComboBox.html)
I hope this helps.
IDK why the first answer was chosen as the correct answer, I hope my answer below can enlarge your knowledge minimally. When your problem was:
"When we type anything in textfield it appends random characters and the search does not work as expected."
I wanna try to understand that statement like this:
"You want to try to search the item on your store or options by typing random character at any position of any matched item"
At this case, you must add these properties to your combobox to achieve the goal:
anyMatch : true, // this is the key
caseSensitive : false, //by default this has been set automatically
minChars: 0,//by default this has been set automatically too
forceSelection: false // set to false to allow free input to textfield with no matched result and set to true to force the user to choose one of the last matched result rather than giving the opportunity to input free text
Before we conclude that the problem is a bug or not, we need to do the whole researches to get the exact conclusion. Don't forget to learn more on
https://docs.sencha.com/extjs/7.0.0/modern/Ext.field.ComboBox.html
Hope this help you.
I am using JTable Jquery plugin, and one of the columns is a checkbox. When creating/editing, this column should show a list of checkboxes of names of locations, which the user can un/check. I've set the type to checkbox as shown below. What else do I need to do to make the checklist show?
location: {
title: 'Location(s)',
width: '50%',
type: 'checkbox',
options: 'http://localhost/proj/locations'
},
The options property returns a list of all the locations. Or how does one specify the list of values to be used? If type was radiobutton, this works alright. When it is checkbox, doesn't work. What else do I need to provide? The docs say one can provide 3 additional options, but these are optional too.
If you want to use checkbox then location field should be Boolean field. Check this link.
Following is example for checkbox:
location: {
title: 'Location(s)',
width: '50%',
type: 'checkbox',
values: { 'false': 'False', 'true': 'True' },
defaultValue: 'true'
},
And you can not use options property with checkbox type. You can only use options property with radiobutton type or dropdown.
I am using AEM 6.1, building a nested multifield component in classic. However, I want the nested multifield (the one inside) to start with 2 text boxes and at every addition, it needs to add 2 more.
I am using the nested multifield implementation from
https://helpx.adobe.com/experience-manager/using/nested_multifield.html
Has anyone tried this? Please do let me know
Thanks!
Looking at the adobe article you referenced: https://helpx.adobe.com/experience-manager/using/nested_multifield.html
If you want the inner multifield to have 2 fields instead of one, you have to change the multifield's fieldConfig from a text field:
fieldConfig: {
"xtype" : "textfield",
allowBlank: false,
},
to a composite field:
fieldConfig: {
"xtype" : "cq.compositefield",
"items": [
{ "xtype" : "textfield", allowBlank: false},
{ "xtype" : "textfield", allowBlank: false}
]
},
you are also going to likely have to update the updateHidden function to make sure you capture all the information from the new composite field.
References:
AEM 6.1 widget api for more information: https://docs.adobe.com/docs/en/aem/6-1/ref/widgets-api/index.html
multifield doc: https://docs.adobe.com/docs/en/aem/6-1/ref/widgets-api/index.html?class=CQ.form.MultiField
compositeField doc: https://docs.adobe.com/docs/en/aem/6-1/ref/widgets-api/index.html?class=CQ.form.CompositeField
I have a dilemma, my code is:
inquirer.prompt([
{
type: 'checkbox',
name: 'Keywords',
message: 'Please select the keywords you would like to use with a maximum of 5.',
choices: [
NewDescriptionKeys[0],
NewDescriptionKeys[1],
NewDescriptionKeys[2],
NewDescriptionKeys[3],
NewDescriptionKeys[4],
]
}
]).then(function (answers) {}//other non-related code is here
My problem is, I can sometimes have more then 5 results, and need to display all of them, so the user can select the ones they want to use, and deselect the ones they don't, I've tried just putting each array until I reach the possible maximum that could be returned, but that just puts undefined's everywhere, any suggestions?
Simplify it with
{
type: 'checkbox',
name: 'Keywords',
message: 'Please select the keywords you would like to use with a maximum of 5.',
choices: NewDescriptionKeys
}
and
Please use the Spacebar to select not enter(return)
(Press <space> to select, <a> to toggle all, <i> to inverse selection)
If you press the enter without selection(without pressing spacebar) then it submits the unselected result with is the empty array.
Enter work as submit
Why not this:
{
type: 'checkbox',
name: 'Keywords',
message: 'Please select the keywords you would like to use with a maximum of 5.',
choices: NewDescriptionKeys
}