Extjs checkboxes inside basic form - extjs

I have a basic form inside a window. This form has several check boxes and I need to some how be able to select all with another checkbox. How am I supposed to access these checkbox types. I am trying to get reference to "this" and then this.getForm().getFieldValues() but is there a better way to do it, as I only need to get the checkboxes and not other fields.
Thanks,
SS

By default ExtJs fields don't have a getForm() method to get access to their parent. However, you can use this override to add this method. Once you've got the form, you can get access to any field you like, which should let you do what you describe.

Related

Disable form filter using expression MS Access

So on one form I have a button than opens a filtered form based on a combobox on the previous form. Works fine. But on the opened form I also have combobox for selecting records - which doesn't work when the form is filtered. I would want to disable the filter when user selects record in that combobox.
Is there a way to disable the form filter using expression in onChange event?
For example:
=[FilterOn]=False
or
=[Filter]=""
These don't work for me though.
Thanks
Cannot be an expression like that in event property. Could build a VBA custom public function with code to neutralize filter and call function in event property. It would be complicated because have to pass form name or form object as argument of function =ClearFilter("formnamehere"). I have not developed function code and really don't think this is best approach.
In most cases, when OnChange event is used, really should be AfterUpdate.

Bind ng-options to form from a custom directive within a ng-repeat

Showing an example will likely make more sense than trying to explain this. Please reference this http://plnkr.co/edit/ipGYEX?p=preview as it ALMOST does exactly what I need.
In the example, click Add to create a new select menu and choose an option. This should add it to the parent form. Currently I'm handling this aspect with an $emit. The core problem is that I can't find a way to assign $index to each select. I'd like to attach it to the model name in order to make each one unique. However, simply doing something like ng-model="selectNum{{$index}} causes an error when passed through attrs.ngModel. As is, the ngModel is repeated for each dropdown that's added and thus, every time the form gets overwritten. I WANT to add each select as a unique object to the form - and update that specific instance should the associated select change.
Can anyone provide some insight on how to either attach the $index or perhaps another way of updating the form?
Not a direct answer to getting the values into the form object, but here's an option similar to something I'm doing for a very similar situation:
http://plnkr.co/edit/uEHFWgRQ9fP2gpeWuE5y?p=preview
Basically storing the values within the elements of the array being repeated on, then I use that object from the model for a post to the server.

Changing the properties of a field dynamically

In my application's viewport i'm showing the form panel with a list of fields in center region and property-grid in east region.
I need to show the list of properties of the field in the property-grid on selection of the field.
The user is able to change the properties.
Now my requirement is to apply the properties dynamically to the field.
Is there any generic way to achieve this?
Can someone help me?
Some properties have getter and setter functions, but not all of them and I doubt they are consistent enough for what you are trying to do.
My suggestion would be to store the config object for each field, the config object would have each property that you want to be able to change using your property grid. When a property changes, remove the field from the form. Re-create it using Ext.create and passing your config object as the second parameter. Then just insert the object back into the form.
EDIT: You can probably skip using Ext.create by using the insert function on your form panel, it seems to be able to accept a config object directly.

How to make an extjs grid a form field?

I have a requirement to create a custom form field that is basically an extjs grid. The user should be able to click a result in the grid. This clicked result should then become the fields value. Also, this field needs to extend Ext.form.field. Here's what I got:
Ext.define('MyApp.field.Grid', {
alias: 'widget.GriedField',
extend: 'Ext.form.field.Base',
I'm a lot of confused on how to add a grid to form field base. Looks like form field base's template expects HTML. How do I get it accept a component?
If you just need to select a value from a list of items. Why not use a combobox?
If you need to select multiple items. There is an example of how to use the MultiSelect ux component in the documentation examples.
http://docs.sencha.com/ext-js/4-1/#!/example/multiselect/multiselect-demo.html
If you really must use a grid. Then I wouldn't bother with trying to create a field type and cause yourself grief.
Add a listener to your grids selectionchange event and update a hidden field in your form with the value you want from the grid. Job done.
I ended up putting the grid on a form indirectly through creation of dependencies on my model.
My model has master-detail, which the detail is just a store reference. I found that using associations did not work for me.
So, in adding a field to a form, I have something that manages changed events for the model (master record) and the detail stores.

ExtJS4: from which class to derive?

I'm working on custom component, which will contain combo and displayfield. It's supposed to be a combobox with validation message next to it.
I'm wondering, from which base class to derive that one in order to have such functionality like store binding ect?
Why don't you use standard ExtJs validation mechanism? It will produce exact outcome you want - a label next to the combobox.
Eventually I found that it can be a simple Ext.panel.Panel.

Resources