如果ELSE条件在胡子网格

时间:2015-07-06 05:52:49

标签: javascript html asp.net-mvc mustache

#include <iostream>
#include <windows.h>
using namespace std;

int main(int argc, const char* argv[])
{
    do
    {
        HWND hwnd = GetForegroundWindow();
        SendMessage(hwnd, WM_KEYDOWN, 0x31, 0);//key 1
        SendMessage(hwnd, WM_KEYUP, 0x31, 0);
        Sleep(1000);
    } while (true);
    return 0;
}

加载系统:

    <table style="font-size:12px;" class="table table-bordered accounts" id="example">
        <thead>
            <tr>
                <th style="text-align:center;">Action</th>
                <th>Plan Name</th>
                <th>Sales Force</th>
                <th>Natl. Acc</th>
                <th>Segment</th>
                <th>Example</th>
            </tr>
        </thead>
        <tbody>
            {{#{accounts}}
            <tr>
                <td style="text-align:center;"><a href="/FormularyData/tabs?segmentid={{PlanId}}"><i class="fa fa-cog fa-2x"></i></a></td>
                <td>{{PlanName}}</td>
                <td>{{PlanTypeName}}</td>
                <td>{{ParentPlanName}}</td>
                <td>{{SegmentName}}</td>
                <td>
                if ({{SegmentName}}=="S")
                    {
                         something
                     }
                else
                     {
                         something
                      }
               </td>

            </tr>
            {{/accounts}}
        </tbody>
    </table>



</script>

Html代码:

 var templateWithData= Mustache.to_html($('#Tmp-Plans').html(),{accounts: data});
$("#con-accounts").empty().html(templateWithData);

1 个答案:

答案 0 :(得分:0)

在您的加载系统中,您可能想要添加类似

的内容
data.segmentNameCheck = function () {
    return data.SegmentName == 'S' 
}

var templateWithData= Mustache.to_html($('#Tmp-Plans').html(),{accounts: data}); 

在模板中

{{#segmentNameCheck}} Something {{/segmentNameCheck}}
{{^segmentNameCheck}} Something Else {{/segmentNameCheck}}