[Users] Synchronized two GridPanel with selectFeature
François BOUSSUGES
f.boussuges at gmail.com
Wed Jun 2 18:34:27 CEST 2010
it's just a little bit different:
1 - click on a row of the gridpanel1
2 - make an event 'clickrow'
3 - get the identifiant value of this row
4 - getRow whith same identifiant in the gridpanel2
(this method it's okay in the two directions , I make 2 events: for
gridpanel1, for gridpanel2).
But when I click on a point of my map, I select the feature row in the
gridpanel1 without 'click'.
The event 'clickrow' is not started and just the row of the gripanel1 is
select.
I think use a event 'selectrow' but this method don't work.
The select between the gridpanels work perfectly, I have just the
problem with the feature select on the map.
Le 02/06/2010 18:23, Pierre Giraud a écrit :
> If I understand correctly, what you're doing is :
>
> 1 - click on the map to select a feature,
> 2 - get an id from an attribute value of the feature,
> 3 - select the corresponding row in gridPanel2,
> 4 - get the "IDENTIFIANT_SITE" attribute value for this row,
> 5 - find the records corresponding to this value in the gridPanel1 store,
> 6 - select the rows in gridPanel1 corresponding to the records.
>
> Don't you think that you're doing too much ?
> Why don't you just drop the steps 3 and 4 ?
>
> Pierre
>
> 2010/6/2 François Boussuges<f.boussuges at gmail.com>:
>
>> A last question, when I replace 'rowclick' by 'rowselect' my event don't
>> work.
>> What is the method for start the event on select row? (when I clik on
>> the map I select a row but without click)
>> François Boussuges a écrit :
>>
>>> It's okay!!!
>>> this is the solution:
>>>
>>> gridPanel2.on('rowclick', function(grid, rowIndex, e) {
>>> var rec = gridPanel2.getStore().getAt(rowIndex);
>>> var val= rec.get("IDENTIFIANT_SITE");
>>> var records =
>>> gridPanel1.store.find('IDENTIFIANT_SITE', val);
>>> gridPanel1.getSelectionModel().selectRow(records);
>>> });
>>>
>>> Use the selectRow because the selectRecords don't work (Why?)
>>>
>>> Thank you very much !!!!!!!
>>>
>>> François Boussuges a écrit :
>>>
>>>> This solution is interesting but I dont understand all in:
>>>>
>>>> var records = grid.store.find('ID_SITE', id);
>>>> grid.getSelectionModel().selectRecords(records);
>>>>
>>>> 'ID_SITE' or id is a value?
>>>> If i take this exemple; id_site=15 what is the correct synthax of the
>>>> script?
>>>>
>>>>
>>>> Pierre Giraud a écrit :
>>>>
>>>>>> Actually I can select the ID_SITE of my selected features but I don't
>>>>>> know what do I do to select the rows with the same ID_SITE in my
>>>>>> second
>>>>>> gridpanel (gridpanel2.selectRows?).
>>>>>>
>>>>>>
>>>>> var records = grid.store.find('ID_SITE', id);
>>>>> grid.getSelectionModel().selectRecords(records);
>>>>>
>>>>> Regards,
>>>>> Pierre
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>> _______________________________________________
>> Users mailing list
>> Users at geoext.org
>> http://www.geoext.org/cgi-bin/mailman/listinfo/users
>>
>>
>
>
>
More information about the Users
mailing list