IBM Support

Using vScroller in In-basket widget - A nice to have feature

Technical Blog Post


Abstract

Using vScroller in In-basket widget - A nice to have feature

Body

Here is a great contribution from one of our active members. Thanks for sharing with the community!

 

Hi,

I just explored a nice to have feature by extending the ICM In-basket widget in v 5.2.1. vScroller feature will be inherited by the extended In-basket widget. This will be useful when there are too many work items in the queue or Inbox and user wants to return to the work item position after closing Work details page (to say when user is not happy to scroll all the way down to 100th work item :p). All we have to do is override the _renderContentList function in the extended In-basket widget. After rendering the In-basket content list call the scrollToRow function like below:

 

_renderContentList : function (index) {
            var inbasket = this.ecmInbaskets[index];
            this.rending = true;
inbasket.retrieveWorkItems(lang.hitch(this, function (resultSet) {
                var cl = this.contentLists[index];
                this._processResultSet(resultSet);
                this._resultSetNexPageConnect(resultSet);
                this._resultSetSortConnect();
                this.setTabDisplayName(this._getInbasketNameWithoutPrefix(inbasket), resultSet.fetchCount, index);
                this.setGridStructure(resultSet);
                this._handleSortIndex(resultSet);
                this.setGridDecorator(resultSet);
                if (!resultSet.repositoryId) {
                    cl.emptyMessage = this.resourceBundle.inbasketFailLoadData;
                } else {
                    cl.emptyMessage = this.resourceBundle.inbasketNoData;
                }
                cl.setResultSet(resultSet);
                if (this._rsConn) {
                    // dojo.disconnect(this._rsConn);
                    this._rsConn.remove();
                    this._rsConn = null;
                }
                if (!resultSet.repositoryId) {
                    this.resize();
                    return;
                }
                // this._rsConn  = aspect.after(resultSet, "onChange", lang.hitch(this,this.onRefresh),true);
                if (this.cursorLocation && this.cursorLocation > 0 && this.cursorLocation < cl.getResultSet().items.length) {
                    cl.grid.select.row.selectByIndex(this.cursorLocation);
                }
                  
                this.resize();
                this.rending = false;
                this.scrollToRowIndex(resultSet,cl); 
            }), this.getInbasketSortColumn(inbasket), this.getInbasketSortDescending(inbasket), false, this.getInbasketFilters(inbasket), this.getInbasketQueryFilter(inbasket), this.getInbasketSubstitutionVars(inbasket));
        },

scrollToRowIndex: function (resultSet, cl) {
            var rowIndex = rowVisualIndex; // {insert your logic to get rowVisualIdenx of the work item}
            if (rowIndex) {
                console.log("Scroll to rowIndex :" + rowIndex);
                setTimeout(function () {
                   autoVScroll= cl.grid.vScroller.scrollToRow(rowIndex, true);
                }, 300);
            }
        },

 

It's working marvelously for me. Feel free to suggest if you have any better idea or better way to do it.

 

Regards,

Ramesh Bhat

[{"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Product":{"code":"SSCTJ4","label":"IBM Case Manager"},"Component":"","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}}]

UID

ibm11280740