Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents


Description

This model can return 4 values.  When the header is clicked will reorder the contents to be ascending and when clicked again, will be descendingAdd a dataQuery tag with the desired query.  Must have equipRef navName and curVal.

Completed Model (Basic)

Download: ractiveTable.f5m

to work you must place on an equip

Ractive Code

Template

Code Block
languagetext
themeEclipse
<table class="view-container s-width">
<tr>
<th class="view-superman-value s-width30">navName</th>
<th class="view-superman-value s-width30">equipRef</th>
<th class="view-superman-value s-width30">curVal</th>
</tr>
{{#myPoints}}
<tr>
<td class="view-superman-value {{#if @index % 2 == 0}} status-stale {{else}} status-disabled{{/if}}">{{#if actions}}<label class="icon-gear s-pointer" on-click="actions"> </label>{{else}}     {{/if}}<label on-click="magicB">{{navName}}</label></td>
<td class="view-superman-value {{#if @index % 2 == 0}} status-stale {{else}} status-disabled{{/if}}" on-click="magicBEquip">{{equipRefDis}}</td>
<td class="view-superman-value {{#if @index % 2 == 0}} status-stale {{else}} status-disabled{{/if}}" on-click="magicB">{{curVal}}</td>
</tr>
{{/myPoints}}
</table>

...

Code Block
languagejs
themeEclipse
var dataPoints = this;
var targetPoint = query('targetPoint and virtualPoint');
var template = this;
var target = query('targetPoint');
    finstack.eval('readAll(equipRef=='+ targetPoint.pointId +' and point).sort("navName")'template.dataQuery).then(function(data) {
    var myPoints      = [];
    var realPoints  = data.result.toObj();
    realPoints.forEach(function(p,index) {
        myPoints.push({
            curVal       : GetPrettyValue(p),
            navName      : p.navName,
            pointId      : p.id,
            equipRefDis  : p.equipRefDis,
            actions      : p.actions || null,
            write1       : p.write1 || null,
            write8       : p.write8 || null
        });
    });
    template.ractive.set({'myPoints':myPoints});
});

...