@shelkovnikovdv
@shelkovnikovdv
Forum Replies Created
-
AuthorPosts
-
shelkovnikovdvMember
Hi Gourav.
After downloading data from the server filters are rendered normally.
But then something is called and makes all cells filter row empty.
This code saves the daylet smartgrid = ... virtualDataSource: function (resultCallbackFunction, details) { ... function refreshFilterPanel() { for (var i = 0; i < smartgrid.columns.length; i++) { smartgrid.columns[i]._filterEditorInitialized = false; }; smartgrid._renderFrozenRows(); } loadFromServer().then( (data) => { resultCallbackFunction({ dataSource: data.items, virtualDataSourceLength: data.totalRecords }); refreshFilterPanel(); .... }) }
Best regards, Dmitry
January 26, 2021 at 12:43 pm in reply to: How to best integrate Vuex store with DataAdapter while keeping databinding #101381shelkovnikovdvMemberHello, friends!
In addition
1) I see in the debugger how DataAdapter notifies about data changes in Smart-Grid through DataAdapter._notify
2) I don’t see how Smart-Grid notifies that it has changed the data in DataAdapter
Is there something I don’t understand or are there no such notifications?
Best regards, Dmitry.January 21, 2021 at 7:56 am in reply to: How to best integrate Vuex store with DataAdapter while keeping databinding #101348shelkovnikovdvMemberHello, friends. Made such an example with code.
1. We have a part in the Vuex storage where we store user data (store\modules\users.js )const state = { all: [] }; const mutations = { SET_ALL(state, payload) { state.all = payload.data; } } const actions = { setItems(context, data) { return context.commit('SET_ALL', { data }); } }
2. We have a Vue list component where we only display and edit usernames. How the data source acts $store.state.users.all
export default { name: 'user-list', props: { value: { type: Array, default: () => $store.state.users.all } } }
3. We have a Vue component with smart grid where you can view all information about users, add, change and delete.
For Smart.DataAdapter me also use $store.state.users.allexport default { name: 'user-grid', methods { getDataSource(data) { return new Smart.DataAdapter({ dataSource: $store.state.users.all, keyDataField: 'id', dataFields: [ 'id: number', 'name: string', 'nick: string', ] }); } } }
4. Now if something is changed in ‘user-list’ it will be reflected in ‘$store.state.users.all’, but ‘user-grid’ will not be automatically updated
Accordingly. If now if something is changed in ‘user-grid’ it will find not automatic reflection in ‘user-list’ and ‘$store.state.users.all’ in the Vuex store will not be updated either
This is our problem. But before rushing into battle, I would like to know if we are reinventing the wheel. -
AuthorPosts