[Users] Synchronized two GridPanel with selectFeature
Pierre Giraud
pierre.giraud at camptocamp.com
Wed Jun 2 18:23:49 CEST 2010
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
>
--
Pierre GIRAUD
Géomaticien, Analyste
Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex
Tel : 00 33 4 79 44 44 93
Mail : pierre.giraud at camptocamp.com
http://www.camptocamp.com
More information about the Users
mailing list