Ronnie_Thomas
Ronnie_Thomas

Reputation: 1

Data binding using jTtemplates with object

I have to access an object in my template, but the problem is the property which I am trying to access is having a space

<script type="text/html" id="TemplateResultsTable"> 
    {#template MAIN} 
    {$T.Asset Category}
</script>

If I am accessing the property without space it works {$T.AssetCategory},but only when am trying to access {$T.Asset Category} it doesnt work.

Upvotes: 0

Views: 109

Answers (2)

Felix Kling
Felix Kling

Reputation: 816472

Anything inside {...} is just JavaScript. You have to use bracket notation if property names are invalid identifiers:

{$T['Asset Category']}

Upvotes: 0

Dilip Rajkumar
Dilip Rajkumar

Reputation: 7074

Did you try %20 for that space.. my suggestion is do not use space.. you can use '-' or '_' instead of space..

Upvotes: 0

Related Questions