This is a migrated thread and some comments may be shown as answers.

Correct markup for grid headers?

0 Answers 35 Views
MVVM
This is a migrated thread and some comments may be shown as answers.
Tina
Top achievements
Rank 1
Tina asked on 02 Aug 2012, 04:43 PM

What's the proper markup for the column titles to bind them to a variable?  Basically, I'm looking to localize the column titles pulling them from a resource file.  My only problem is figuring the correct markup to display the header.

I know this works
<div id="CityCodeGridView" data-role="grid" data-bind="source: gridDataSource" data-sortable="true"
       data-editable="true" data-toolbar='["save", "cancel"]' data-columns='[{"field": "CityAlpha", "title": "city code" },
                                                                                    {"field": "CityNumeric", "title": "iata city code"},
                                                                                    {"field": "Description", "title": "description"},
                                                                                    {"field": "NextFlightEnabled", "title": "next flight enabled"},
                                                                                    {"command": "destroy"}]'
       data-scrollable="false">
    
</div>

but I'm looking for something like this
<div id="CityCodeGridView" data-role="grid" data-bind="source: gridDataSource" data-sortable="true"
       data-editable="true" data-toolbar='["save", "cancel"]' data-columns='[{"field": "CityAlpha", "title": userMsgs.CityCode },
                                                                                    {"field": "CityNumeric", "title": userMsgs.IataCityCode},
                                                                                    {"field": "Description", "title": userMsgs.Description},
                                                                                    {"field": "NextFlightEnabled", "title": userMsgs.NextFlightEnabled},
                                                                                    {"command": "destroy"}]'
       data-scrollable="false">
    
</div>
where the title is a member property.  Thanks.

No answers yet. Maybe you can help?

Tags
MVVM
Asked by
Tina
Top achievements
Rank 1
Share this question
or