-
Notifications
You must be signed in to change notification settings - Fork 427
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
WIP - feat(RowDetail): add 2x new subscribe methods & fixed multiple issues #281
Conversation
- add "onRowOutOfVisibleRange" subscribe - add "onRowBackToVisibleRange" subscribe - expose "collapseItem" public - add new "keyPrefix" property to change the key prefix of all metadata used by the plugin that appears on the item object - use "item" everywhere instead of "itemDetail" in some areas (however make it to work with both so that it doesn't break anyone's code) - changed all containers to classes instead of ids (e.g. id="detailViewContainer_2" is now class"detailViewContainer_" on the DOM element) - add Filter example and padding tweak - add JS code with dynamic template examples - fixed some issues found and cleaned up unused code
@SatanEnglish Also note that I updated the demo to show some JS examples of a button click in the dynamic template. I use the 2 new subscribe methods to trigger a refresh of the JS (basically re-attaching a button |
I'll have a quick try now to update my code to use the new stuff and see how it goes. |
@SatanEnglish I also forgot to mention, that the function Thanks |
Couple of things I have in my current version that are missing from here. in resizeDetailView I now have.
Think the last saveDetailViewis so that I can call resizeDetailView on outside and it resize and save the new size. Also I have
e.g in detailSelectionFromatter
|
I also resize my grid every now and then. Question here is will I need to calls your calculateVisibleRenderedCount to recaculate the height? |
@ghiscoding
|
@ghiscoding e.g.
Don't think I could handle this through pure css. (Think it's that the calculation for height is our by nearly a row and this is to deal with the little extra white space at the bottom) |
@SatanEnglish
I removed 1 of the
I added a trigger on browser resize to recalculate the visible lines because if you make the window bigger then the amount of displayed rows might change and it affects my calculation
You can look at the PR for all the changes made to the file itself. I did lot of cleanup, so yes it's possible that I deleted some of your previous code. |
mainContainer.setAttribute("style", "max-height: " + item[_keyPrefix + 'height'] + "px"); cannot be used on a document.getElementsByClassName |
@ghiscoding |
@ghiscoding I understand why you have put it as a getElementsByClassName instead of the getElementById. BUT how do we make it so that it's unique to update attributes hence Y it was an id |
@SatanEnglish All that I can see is, it's changing from Again feel free to do some commits on my repo on the branch name |
@ghiscoding For example doing $('.detailViewContainer_2')[0] would be what the current code does. Is there a unique ID on the grid I can get to? Then we could append that to the class name |
// This has to be like this else it doesnt work Your version Do you get the same issue ur end? Or have u not tryed with large view in there |
@ghiscoding I'll have a go at updating your PR when I do |
@ghiscoding So that I can get some idea around the best way to fix some stuff |
@SatanEnglish |
closing, replaced by #287 |
DO NOT MERGE
This PR will be replaced by another PR that we are currently ironing out in my local repo.
This PR might also close #252
onRowOutOfVisibleRange
subscribeonRowBackToVisibleRange
subscribecollapseItem
publickeyPrefix
property to change the key prefix of all metadata used by the plugin that appears on the item objectcollapseAllOnSort
boolean flag to provide possibility to implement it's own code for on sortsaveDetailViewOnScroll
boolean flag because saving detail is not used by all frontend frameworksitem
everywhere instead ofitemDetail
in some areas (however make it to work with both so that it doesn't break anyone's code)cssClass
which was not fully implemented in the codeThere's a lot of changes, but I believe that it will be a simple plug & play for most users. The biggest feature is the additions of 2x new subscribe methods to let the user know when the Row Detail View is out or back to visible range. Also a working sample with Filters is a nice addition.