how to unselect a selected row in a grid from view model

15 views
Skip to first unread message

mauro larese

unread,
Apr 12, 2014, 6:03:46 PM4/12/14
to gl...@googlegroups.com
thanks in advance
- Mauro

Ryan Smith

unread,
Apr 12, 2014, 6:10:58 PM4/12/14
to gl...@googlegroups.com

You should be able to set the selections array of the record or records that you want selected.  I'm on my phone now, but if you need an example... Just let me know. 

Ryan

On Apr 12, 2014 3:03 PM, "mauro larese" <mauro....@gmail.com> wrote:
thanks in advance
- Mauro

--
You received this message because you are subscribed to the Google Groups "GluJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to glujs+un...@googlegroups.com.
To post to this group, send email to gl...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/glujs/cb839a3a-8767-43a6-8d14-b252f3d91f98%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

mauro larese

unread,
Apr 12, 2014, 6:26:52 PM4/12/14
to gl...@googlegroups.com
i want unselect the row .... i tried this

if the array is
gridSelections i set it to [] to unselect the row but no result


Ryan Smith

unread,
Apr 12, 2014, 6:41:41 PM4/12/14
to gl...@googlegroups.com

Hmmm... That has worked for me in the past without any problems... I'll try to get you an example when I get back to a computer.

Ryan

Josh VanderLinden

unread,
Apr 12, 2014, 8:57:22 PM4/12/14
to gl...@googlegroups.com

Mauro, how did you set it to []? With gridSelections = []? Or with this.set('gridSelections', [])?

What if you use "this.gridSelections.length = 0" or "this.gridSelections.splice(0, this.gridSelections.length)" to actually clear the existing array rather than creating a new array entirely?

mauro larese

unread,
Apr 13, 2014, 1:24:40 PM4/13/14
to gl...@googlegroups.com
nothing work, so i tried from the view vita the selection model ... no way ... so the problem is the grid


mauro larese

unread,
Apr 15, 2014, 3:57:38 PM4/15/14
to gl...@googlegroups.com
did you discover anything?
thx
Mauro

Mi-e Foame

unread,
Apr 15, 2014, 4:00:36 PM4/15/14
to gl...@googlegroups.com
Perhaps it would help if you could share some of the code you're dealing with? Maybe mock up a simple example that reproduces the problem, then we can try to pick out any issues?

Ryan Smith

unread,
Apr 15, 2014, 4:22:55 PM4/15/14
to gl...@googlegroups.com
Sorry about the delayed response... I was out of town over a long weekend.

Without examples its difficult, but I have some common pitfall ideas.  Are you using name binding on the grid?  To get the selection binding you should have a named grid so that glujs will bind the selections to the name of the grid + selections.  For example...

view: 
{xtype: 'grid', name: 'myGrid'}

viewmodel:
{myGrid: {mtype: 'store'....}, myGridSelections: []}

The name binding will bind to the store and the selections if they are defined in the viewmodel.  In this case changing the myGridSelections through the set in the viewmodel ( this.set('myGridSelections', []) ) should work to clear the grid selections. 

This has worked for me in the past, so let me know if it doesn't.  If you do have a named grid though... then I'll have to see an example in order to help any further :(.  Sorry...

-Ryan 


--
You received this message because you are subscribed to the Google Groups "GluJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to glujs+un...@googlegroups.com.
To post to this group, send email to gl...@googlegroups.com.

mauro larese

unread,
Apr 15, 2014, 4:52:48 PM4/15/14
to gl...@googlegroups.com
i use the asset example to try if your example is working and ........ it  works perfectly. So it must be a problem in the my application
anyway thank you for your help


Mi-e Foame

unread,
Apr 15, 2014, 4:59:49 PM4/15/14
to gl...@googlegroups.com
This is one of the best and worst realizations I come to on a regular basis. I so very badly want to blame someone else at all times, but then I realize it's usually my own problem that I have to take care of... *sigh*

It might be helpful if you can describe your solution here once you find it, just in case someone else sees the same behavior. Good luck!
Reply all
Reply to author
Forward
0 new messages