-
29 Jul 2009 3:44 PM #1
Composite primary key - N:M relationship - reader problem
Composite primary key - N:M relationship - reader problem
I have a table that have a composite primary key.
How can I do a reader with that?
I found this thread about that.
I want to know, is there a better solution for that?
http://extjs.com/forum/showthread.php?t=27433&
I search on api and examples and didn't find anything about it.
[]'s
-
30 Jul 2009 10:31 AM #2
-
30 Jul 2009 1:41 PM #3Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- The Netherlands
- Posts
- 24,251
- Vote Rating
- 41
That solution was only to get the correct id. If you don't care about the id value you can also have it auto-generate (don't specify an id or idProperty/idIndex).
There's also a patch floating around that modifies getJsonAccessor so it accepts functions (so you can build any id you want).
-
30 Jul 2009 1:58 PM #4
Thanks Condor.
But I really need the ID.
The table has 2 id's, from another 2 tables.
So, I need the id's to update the values in the correct registry.
I think the only solution is that you have explained in the other thread, correct?
Is there a better one?
And at my controller, I have to separate the id's that are posted, right?
Another thing, i searched about getJsonAccessor and didn't find anything about on api.
What's is that?
[]'s
-
30 Jul 2009 2:00 PM #5Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- The Netherlands
- Posts
- 24,251
- Vote Rating
- 41
Do you really need an id? I think you only need 2 fields with the id values.
ps. getJsonAccessor is a private method of JsonReader, so it isn't documented.
-
30 Jul 2009 2:06 PM #6
Hum, right condor!
I was thinking about the id's that I just forget that I can post then as simple fields....
Thanks condor!
Thread resolved!
Just one more thing, the method getJsonAccessor do what?
I searched on forum and found some threads with that but I didn't understeand what it does.
[]'s
-
30 Jul 2009 2:34 PM #7
As my understanding the JsonAccessor does the mapping.
vg Steffen
--------------------------------------
Release Manager of TYPO3 4.5
energlobe.de - german online magazine
-
30 Jul 2009 2:35 PM #8Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- The Netherlands
- Posts
- 24,251
- Vote Rating
- 41
It's used to convert a mapping to a function that retrieves the data from the JSON object, e.g.
is converted to:Code:mapping: 'myfield'
Code:function(o){return o['myfield'];}
-
30 Jul 2009 2:37 PM #9
Ok, thank you!
Now, thread really resolved!
[]'s


Reply With Quote