PDA

View Full Version : Checkboxgroup & Radioboxgroup loadRecord Support



dancablam
12 Jun 2009, 3:35 PM
I know in 3.0 RC2 getValue and setValue were added to checkboxgroups and radioboxgroups. However, when loading data into a form (form.getForm().loadRecord(rec)) the check/radio groups are being ignored so I assume loadRecord support has not been added to them?

If that's the case - are there plans to support record loading? Since these groups commonly contain a large amount of checkboxes/radios, record loading support, I think, would be critical to their usefulness.

Cheers,
Dan

evant
12 Jun 2009, 11:17 PM
Please post a test case. The same code should run with in 3.x as well, http://extjs.com/playpen/tickets/T221/test.html

The loadRecord works there.

dancablam
13 Jun 2009, 6:19 AM
Please post a test case. The same code should run with in 3.x as well, http://extjs.com/playpen/tickets/T221/test.html

The loadRecord works there.

Hi Evan,

I've posted a test case here: http://www.punchcode.com/shared/checkboxgrp_lr.html

You'll see that while the textfield and a checkbox that is not part of the group works, no checkboxes that are a part of the group respond to the loadRecord.

Thanks for your help on this.

Cheers,
Dan

evant
13 Jun 2009, 10:25 PM
Your data doesn't match, have a look at the possible ways you can call setValue for a checkboxgroup, the docs show a series of methods.

dancablam
14 Jun 2009, 1:41 PM
Hi Evan,

The data does in fact match. Have a look at the link below where I have the exact same data except I've removed the checkboxes from a checkboxgroup and let them just be regular checkboxes. The load record works perfectly: http://www.punchcode.com/shared/checkboxnogrp_lr.html

I understand that you can setValues - but that brings me back to my orignial question: It appears loadRecord support is not included. IMHO radio and check groups should integrate seamlessly into their parent and form be capable of loading records, etc. It's not practical to load a record into a form and then also have to setValues({check1:1,check2:1,...}).

What do you think? Thanks for all your help.

Cheers,
Dan

evant
14 Jun 2009, 9:35 PM
loadRecord does work, you can see that from the example code there. The problem is that you're treating them as single checkboxes. Since you're putting the boxes in a checkbox GROUP, the assumption here is that you'll be treating them as a group, not loading them individually as single fields (otherwise what's the point of having a group?).

As I said, look at the documentation for setValue() (which is what loadRecord calls) and see the various option available there. What would most likely suit your case:



foo.loadRecord({
idOfGroup: {
check1: true,
check2: true//etc
}
});

mmartz
27 Jul 2010, 9:36 AM
The point of a checkbox group or radio group (at least in my use case) is to GROUP items visually on the screen. Not to group them as distinct data elements on the backend. This should at least be a customizable option. Especially when you consider that doing a submit on a form sends the checkboxes across normally. (ie, someurl?check1=true,check2=true)