scottdurow / SparkleXrm

An open-source library for building Dynamics CRM XRM solutions using Script#, jQuery & Knockoutjs.
MIT License
265 stars 197 forks source link

Change Grid based on dropdown view #110

Open KK1674 opened 8 years ago

KK1674 commented 8 years ago

Scott,

I have a requirement to make the grid dynamic based on view selected. columns will not be dynamic.

I will be having dropdown that will allow user to select active and inactive option in dropdown. initially grid will load active records.. after that user can select inactive option from dropdown.

Active view will be having editable grid. inactive view will be having non editable grid.

Active grid will allow user to add,update,delete and change status. it is editable grid. It is working fine.

For now i have added a method in view like init. initopen will be having query to fetch active and initclosed will be having query to fetch inactive records. I was able to achieve requirement.

It doesn't look like good option to call every time. once i do this the existing update, delete, create functionality doesn't work properly.

Need some suggestion.

KK1674 commented 8 years ago

Any suggestion?

scottdurow commented 8 years ago

If you want to have filtering on the grid and also editing - then you may need to load all the records and then filter in the ViewModel otherwise you'll have to discard your edits each time you re-load the grid.