This question already has an answer here:
Closed 11 years ago.
Possible Duplicate:
Want to create a combobox in dojo where the dropdown menu and autocompletion kicks in only after the user inputs 4 characters
Am creating a combox box and populating it from an item file store.i need the drop down to be populated only after entering 4 characters, could you guide please. Am pretty new to dojo. i got a sugestion on extending dojo methods,but i have no idea how to do that.
var foo = new dijit.form.ComboBox({
autoComplete: false.
intermediateChanges: true,
onChange: function(value) {
if(value.length < 4) {
this.autoComplete = false;
} else {
this.autoComplete = true;
}
}
}, srcNode);
or something like that
Related
I have got a Vaadin Combobox (Vaadin 8) to which I add two items. I would like that ComboBox to propose all views to which the user is supposed to navigate by a Vaadin NativeButton as described in the code snippet. In spite of the fact that "ContactView" is proposed below the ComboBox as soon as I type a "C", I cannot select "ResourceView" - and yet I have added it to theComboBox. What did I get wrong so that there is no correct dropdown?
navigatorCombobox = new ComboBox<String>("Navigate to...");
navigatorCombobox.setItems(Arrays.asList("ContactView", "ResourceView"));
navigatorButton = new NativeButton("go");
navigatorButton.addClickListener(
event -> {
if(StringUtils.isNotEmpty(navigatorCombobox.getValue()) && navigatorCombobox.getValue().equals("ContactView")) {
getUI().getNavigator().navigateTo(MynavigatorUI.CONTACTVIEW);
} else if (StringUtils.isNotEmpty(navigatorCombobox.getValue()) && navigatorCombobox.getValue().equals("ResourceView")) {
getUI().getNavigator().navigateTo(MynavigatorUI.RESOURCEVIEW);
}
});
This is intended behavior. Once you type "C" in the field, ComboBox will limit selectable options to those starting with "C".
I have multiple buttons with similar names. Major similarity is the suffix _min.
How can these all be disabled based upon the part of the name (and thus not based upon whole name?
btnX_min.IsEnabled = false;
btnY_min.IsEnabled = false;
btnZ_min.IsEnabled = false;
Needs to become:
for all buttons with string _min in Name, IsEnabled = false
How to accomplish?
Depending on where all these buttons are located in your Visual tree you might want to use the VisualTreeHelper class to be able to find all of them. Please refer to the recursive FindVisualChildren method here:
Find all controls in WPF Window by type
...and try this:
foreach (Button button in FindVisualChildren<Button>(this).Where(x => !string.IsNullOrEmpty(x.Name) && x.Name.Contains("_btn")))
button.IsEnabled = false;
I didnt check but try this:
IEnumerable<Button> buttons = mainGrid.Children.OfType<Button>(); //GridMain is the main Layout
foreach (Button btn in buttons)
{
if (btn.Name.Contains("_min"))
{
btn.IsEnabled = false;
}
}
My Problem:
This is my form
I would like to just filter out same ID rows
Barely any code to show pretty much dragged and dropped entity-es and did some customizing.
Toolstrip and datagrid are binded to same source
My Goal:
I would like my form to filter out only the rows with same ID as ID in textbox when I navigate with toolbox buttons
My thoughts so far: Perhaps I can make a query where ID in textbox matches ID in first column and weed out those rows and just display them. But how would that keep the format I have? Comboboxes etc.. some columns have different binding sources, for example column #2, column#3 are have different binding sources as opposed to column#1(to which i'm trying to filter rows) and column#4,5
Edit: I have tried following
nastavniPlanProgramDataGridView.CurrentCell = null;
foreach (DataGridViewRow row in nastavniPlanProgramDataGridView.Rows)
{
if(row.Index!=rowIndex)
{
row.Selected = false;
row.Visible = false;
}
else
{
if(row.Index==rowIndex)
{
row.Selected = true;
row.Visible = true;
}
}
However i keep encountering an error when executing row.Visible=false;
Solved by simply adding the following before executing the above code-snippet in the question.
AllowUserToAddRows = false;
I have an issue where the value of a dropdown field is not getting persisted when saved and reopened. It has a default value of 1 month. when I change it to 4 months, save it and reopen the page, the value gets set to 1 month. I made a fix with the following code. But now I am able to see the new value of 4 months, but there is another window that is opening up. Please tell me why. Here's my code.
listeners: {
afterrender: function(grid) {
var record = grid.getStore().getAt(0);
var newPullWindow = Ext.ComponentQuery.query('#pullWindowItem')[0];
if (!Ext.isEmpty(record)) {
var newPullWindowValue = record.get(newPullWindow.dataIndex);
newPullWindow.setValue(newPullWindowValue);
}
}
}
I'm working with an ExtJS 4 propertygrid that can list three different kinds of items that display when clicked on in another grid. One kind of item has to have a particular field hidden, so that it is't shown but any updates caused by editing other fields aren't affected by potentially missing information.
Attempts of using hidden/isHidden/visible/isVisible, with quoted and unquoted true/false values, haven't worked, and show the ShapeLength field in the propertyGrid.
Is there a "hidden: true" setting within the sourceConfig that I can apply somehow?
Example code:
var lengthDisplayName = '';
if(record.data.Type_ID == 'Circle(s)'){
lengthDisplayName = 'Radius (mm)';
}
if(record.data.Type_ID == 'Triangle(s)'){
lengthDisplayName = 'Side Length (mm)';
}
detailsGrid.sourceConfig['ShapeLength'] = {displayName: lengthDisplayName, type: 'number'};
if(record.data.Item_No == '-1'){
detailsGrid.sourceConfig['ShapeLength'] = {
displayName: lengthDisplayName,
type: 'number'
//, hidden/isVisible/visible value set here
}
};
No there is no hidden property for sourceConfig. But one possibility is to remove the property from the sourceConfig and reinsert it if it should be visible again.
delete detailsGrid.sourceConfig['ShapeLength'];
Was directed to an answer by a colleague - I can getRowClass within the propertyGrid and apply a hidden style on source data for an identifying property and the row name to hide, or else return out:
detailsGrid.getView().getRowClass = function(row) {
if(detailsGrid.source['Item_No'] == '-1' && row.data.name == 'ShapeLength')
return 'x-hidden';
return;
};