Hi Support,
My scenario as follows :
After the other process update the data, I want to Click the button to
refresh
QueryBuilder data from database again by the Created() event . But it return null for the reference SfQueryBuilder object .
Attach is my project (Page-->View-->ViewModel).
Please kindly help!
Jacky
Hi Jacky,
Sorry for the delay. We have validated your attached sample, and the reason for the reported issue is that the query builder is created only when we open the dialog popup and destroyed when the dialog popup is closed. After you closed the dialog popup, you were using the query builder reference, and it threw an error. And could you please share what are trying to do in refresh QueryBuilder button click. Because you have already taken the data manager query and refreshed the view in the OkClick function, and again, you took the same action in the refresh QueryBuilder button click.
public void OkClick() { GridQuery = querybuilder.GetDataManagerQuery(); thisView.NeedRefreshAsync(); this.IsShowQueryBuilder = false; } |
If you share the exact use case/details for refresh QueryBuilder button click, we will check and provide the better solution.
Regards,
YuvanShankar A
Hi YuvanShankar,
I simulated my project requirements, first step [Update Order Data] button will open a dialog , it will update the Order data Sequenct to the database table by SfListBox Drag & Drop, and then close the Dialog will [Refresh QueryBuilder] to requery and synchronize the data in Querybuilder and Grid.
Best Regards!
Jacky
Open a Dialog for Drap & Drop adjust the Order
sequence with SfListBox and update to database.
Jacky,
As we started earlier, when dialog popup closes the query builder element will destroy, so we can’t take query builder instance after closed the dialog popup. So, kindly assign the GetDataManagarQuery in another variable, and used that variable while click on refresh QueryBuilder button.
public void OkClick() { GridQuery = DummyQuery = querybuilder.GetDataManagerQuery(); thisView.NeedRefreshAsync(); this.IsShowQueryBuilder = false; } ……. public void RefreshQueryBuilder() { GridQuery = DummyQuery; thisView.NeedRefreshAsync(); } |
Get back to us if you need any further assistance on this.
Hi YuvanShankar,
I'm sorry, maybe I didn't express myself clearly enough.
If I use the DummyQuery in RefreshQueryBuilder(), the data is not the Actual data in the database.
It must reopen the QueryBuilder dialog and trigger the OkClick() event.
Best Regards!
Jacky
Sorry for the delay, Jacky.
From your last update, we suspect that you changed the database of the grid component and need to refresh the grid with the latest dataSource using the existing filter. And as we already said, the filterQuery variable does not depend on the dataSource except that you didn’t change any fields. So, refresh with the existing filterQuery variable filters the proper result with the latest datasource. If you change the fields of the dataSource, then you must open the query builder and create a new query with new fields to filter the dataSource.
Hi YuvanShankar,
i understand, Thank for your kindly help!
Best Regards!
Jacky
You're welcome, Jacky. We are glad to hear that your issue has been resolved now. Please get back to us if you need any other assistance.
Note: If that post is helpful, please consider accepting it as the solution so that other members can locate it more quickly.