Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[QUESTION] Filter values change #81

Closed
guanjiwang2016 opened this issue Apr 12, 2017 · 5 comments
Closed

[QUESTION] Filter values change #81

guanjiwang2016 opened this issue Apr 12, 2017 · 5 comments
Labels

Comments

@guanjiwang2016
Copy link

guanjiwang2016 commented Apr 12, 2017

Hello,

I want to get some technical help from you as I have met some difficulties.

The existed function :

In query form, we have parent filter and children filter, the children filter values are changed and shown according to the selected value(s) in parent filter by executing an SQL command in the backend.

The expected function :

I want to change and show the children filter values according to the selected values in parent filter not by executing the SQL but by the pre-saved value list or store in js controller.

What I have done for it:

  1. Create a new form component js in client public and add new fire event in both controller and component js, according to the parent change.
  2. Locate the target form container in formController.
  3. Successfully get the parent/children parameter's type, value and their connection but there is no method for setting personal values directly to children parameters. Children values are changed and shown only by store, proxy, property.

Can you give me some instruction about how to do the rest, please?
Thank you for your help.
regards,
Guanji

@PabloA-dev-coder
Copy link

Hi,
Can we have a status on that please ?

Best regards
Pablo

@bfiorito
Copy link
Member

Hi Guanji,

I’m not sure to correctly understand your problem so i’ll try to sum up
just to clearify :
You are working with form components, espacially combobox ( = parent and
children filter) and you try to filter children client-side after selecting
something in the parent combobox, is it right ?

If it’s the case, i think you can try to :

1- Change queryMode in children combobox in order to load local data :

​queryMode : 'local'

2- ​Try to use MemoryProxy in the children store (many examples in SITools) in order to add data manually

proxy : {
                type : 'memory',
                reader : {
                    type :'json',
                    root : 'dataset.columnModel',
                    idProperty : 'id'
                }
            }}

3- Use store.add() or store.loadData() methods, to add new records according to the store’s model.

​Let me in touch if i have answered to your question​.

​Best ​Regards,
Bastien​

@guanjiwang2016
Copy link
Author

Hi Bastien,
Thank you for your reply. Yes, that's what we want to do exactly.
But I want to add store.load locally for SOHOListBoxMultiple(like ListBoxMultiple),

I have created the store, model, fire event, but I don't know how to load the local store, here are my codes,
1- My store:

selection_292

2- My model:
selection_293

  1. Add fireEvent in the listeners in client-public/js/forms/components/ListBoxMultiple.js:
    selection_294

  2. Add event detail in fireEvent in client-user-3.0/app/controller/component/form/FormController.js, try to load store locally but not by proxy:
    selection_295

Can you give me an example, please?
Thank you very much.
Regards,
Guanji

@bfiorito
Copy link
Member

Hi Guanji,

We wrote an example for you, let me know if it helps you :

https://fiddle.sencha.com/#view/editor&fiddle/2201

@guanjiwang2016
Copy link
Author

Hi Bastien,

That is super! 
Thank you so much!

Best regards,
Guanji

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants