Skip to main content
1-Visitor
June 1, 2017
Solved

List select everything by default

  • June 1, 2017
  • 1 reply
  • 2329 views

Hey guys,

How can I select all item in the list by default? Now this is what I have so far, but as you see, the selected rows in the list doesn't show anything. But then, if I change the selection, the grid is populated with the new selected item. So basically, I can select every rows by default, but the it appears like the selected rows is null. And I would need the selected rows to be All instead at default.

Best answer by posipova

I created a Jira on this, /PSPT-3737.

I can select all items of the list at default (upon mashup loading) but they do not reflect in the grid immediately:

1 reply

20-Turquoise
June 1, 2017

Let me run this on my instance, and I will get back to you soon.

fgrondin1-VisitorAuthor
1-Visitor
June 2, 2017

Just for more information about this,

I've tried adding a property like the autoselectfirstrow.

I've got this part of code which doesn't work.

//else if ( this.getProperty( 'SelectAllDefault' ) === true )

                    //{

                    //    TW.log.error( "1b" );

                    //    // do this with delay ... if you have a lot of grids accessing the same data, they may not have populated and we're already telling them the row to select

                    //    setTimeout( function ()

                    //    {

                    //        // make sure we haven't been destroyed

                    //        if ( mygrid !== null )

                    //        {

                    //            TW.log.error( "2b" );

                    //            // select the first row

                    //            var numRows = mygrid.getRowsNum();

                    //            TW.log.error( numRows );

                    //            var selected = [];

                    //            for ( var i = 0; i < numRows; i++ )

                    //            {

                    //                selected.push( i );

                    //                TW.log.error( "numb : "  +numRows );

                    //            }

                    //            thisWidget.ignoreSelectionChanges = true;

                    //            for ( var i = 0; i < selected.length; i++ )

                    //            {                                

                    //                mygrid.selectRow( selected, false, false, true );

                    //                TW.log.error( "selected : " + selected );

                    //            }

                    //            thisWidget.ignoreSelectionChanges = false;

                    //            thisWidget.updateSelection( 'Data', selected );

                    //        }

                    //    }, 100 );

                    //}

posipova20-TurquoiseAnswer
20-Turquoise
June 5, 2017

I created a Jira on this, /PSPT-3737.

I can select all items of the list at default (upon mashup loading) but they do not reflect in the grid immediately: