如何让中继器在 2sxc 中工作?

How to get repeater working in 2sxc?

我被复读机搞糊涂了!无论我尝试使用列表还是 table,在针对 Data("Default"):

进行迭代时,我只会得到一个 table 大小为 1 的开头

@foreach(var cont in AsDynamic(Data["Default"])){

如果我进入 Content.Toolbar,第二组图标包括一个 + 和 - 似乎设置要显示的行数,2 或 3 有时可以,但迟早我会得到一个一条记录重复,尽管在内容数据 table 中只有 1 条数据。嗯嗯。

这是我看到的,table 有重复的行:(抱歉,我不能 post 超过 2 张图片,因为我在 Stackflow 上还没有声誉。)

Number  Status  Priority  Title  Life  Property  Address  Eye Witness Name  Eye Witness Contact  Time  Assigned To  Description  Entered at  Modified  Outcome  Mapping
Number  Status  Priority  Title  Life  Property  Address  Eye Witness Name  Eye Witness Contact  Time  Assigned To  Description  Entered at  Modified  Outcome  Mapping
1188  0 - New (Unassigned)  0 - New (Unassigned)  Ranting Hippies taking over Island Center Forest  LIFE!  Property!  100 Vashon Way, Vashon, WA 98070  Sally Suzie  567-1000  6/6/2016 10:00:00 PM  Community Operations Section  

Reports are coming in that unruly hippies are taking over the land immediately north of the transfer station.
  6/7/2016 12:01:13 AM   Map it!
1188  0 - New (Unassigned)  0 - New (Unassigned)  Ranting Hippies taking over Island Center Forest  LIFE!  Property!  100 Vashon Way, Vashon, WA 98070  Sally Suzie  567-1000  6/6/2016 10:00:00 PM  Community Operations Section  

Reports are coming in that unruly hippies are taking over the land immediately north of the transfer station.
  6/7/2016 12:01:13 AM   Map it!
1188  0 - New (Unassigned)  0 - New (Unassigned)  Ranting Hippies taking over Island Center Forest  LIFE!  Property!  100 Vashon Way, Vashon, WA 98070  Sally Suzie  567-1000  6/6/2016 10:00:00 PM  Community Operations Section  

Reports are coming in that unruly hippies are taking over the land immediately north of the transfer station.
  6/7/2016 12:01:13 AM   Map it!
1188  0 - New (Unassigned)  0 - New (Unassigned)  Ranting Hippies taking over Island Center Forest  LIFE!  Property!  100 Vashon Way, Vashon, WA 98070  Sally Suzie  567-1000  6/6/2016 10:00:00 PM  Community Operations Section  

Reports are coming in that unruly hippies are taking over the land immediately north of the transfer station.
  6/7/2016 12:01:13 AM   Map it!
1188  0 - New (Unassigned)  0 - New (Unassigned)  Ranting Hippies taking over Island Center Forest  LIFE!  Property!  100 Vashon Way, Vashon, WA 98070  Sally Suzie  567-1000  6/6/2016 10:00:00 PM  Community Operations Section  

Reports are coming in that unruly hippies are taking over the land immediately north of the transfer station.
  6/7/2016 12:01:13 AM   Map it!

这是模板

<!-- Table View of Incident Log Entries -->
<div>@Edit.Toolbar(actions: "new", contentType: "Incidents")</div>
<div style="overflow-x:auto;">
<table>
    <thead>
        <tr>
            <td>Number</td>
            <td>Status</td>
            <td>Priority</td>
            <td>Title</td>
            <td>Life</td>
            <td>Property</td>
            <td>Address</td>
            <td>Eye Witness Name</td>
            <td>Eye Witness Contact</td>
            <td>Time</td>
            <td>Assigned To</td>
            <td>Description</td>
            <td>Entered at</td>
            <td>Modified</td>
            <td>Outcome</td>
            <td>Mapping</td>
       </tr>
    </thead>
    <tfoot>
        <tr>
            <td>Number</td>
            <td>Status</td>
            <td>Priority</td>
            <td>Title</td>
            <td>Life</td>
            <td>Property</td>
            <td>Address</td>
            <td>Eye Witness Name</td>
            <td>Eye Witness Contact</td>
            <td>Time</td>
            <td>Assigned To</td>
            <td>Description</td>
            <td>Entered at</td>
            <td>Modified</td>
            <td>Outcome</td>
            <td>Mapping</td>
        </tr>
    </tfoot>
    <tbody>
        @foreach(var cont in AsDynamic(Data["Default"])){
            @:<tr class="sc-element sexy-table-row sexty-table-row-@cont.EntityTitle">
                @:<td>@cont.EntityId</td>
                @:<td>@cont.Status</td>
                @:<td>@cont.Priority</td>
                @:<td>@cont.Title</td>
                @:<td>
                if (cont.Life) { 
                    @:<span style="color:red;"> LIFE! </span>
                }
                @:</td>
                @:<td>
                if (cont.Property) { 
                    @:<span style="color:orange;"> Property! </span>
                }
                @:</td>
                @:<td>@cont.Address</td>
                @:<td>@cont.EyeWitnessName</td>
                @:<td>@cont.EyeWitnessContact</td>
                @:<td>@cont.IncidentTime</td>
                @:<td>@cont.AssignedTo</td>
                @:<td>@Html.Raw(cont.Description)</td>
                @:<td></td>
                @:<td>@cont.Modified</td>
                @:<td>@Html.Raw(cont.Outcome)</td>
                @:<td>@cont.Mapping</td>
            @:</tr>
        }
    </tbody>
</table>
</div>
</br>
@Content.Toolbar
</br>

这是Template configuration

这是Content-Data table (which I notice doesn't have duplicated rows!!!)

此外,一旦我显示了足够多的行(我必须手动添加我想要的每一行 - 或列表项?)然后我必须弄清楚分页。我看到的唯一选择是通过数据管道提供的分页小部件,对吧?!我似乎还没有任何关于分页的例子。

这真的很棒,我会尽力帮助添加到文档中,因为仍然有一些漏洞 (;->)

你可能被

难住了
  1. 全部!您应用中的数据(您将使用 App.Data["typename"]
  2. 检索这些数据
  3. 只是分配给这个 2sxc 实例数据的数据["Default"]

使用上述方法创建项目时,您很可能会在应用中创建一个新项目,但不会将其分配给实例。它更像是一个跨越所有项目的数据库,而不仅仅是这个实例的项目。

当您为当前项目创建工具栏时,它可以为当前实例提供"add" 按钮或"new" 按钮。但为此它需要在 Edit.Toolbar(Content, actions: "new") 上,因为它将使用当前实例的内容类型并将其按顺序添加到当前项目之后。

明白了吗?