0

我正在尝试将一个按钮放入网格中。为了实现这一点,我想使用 rowTemplates。但是,我在获取和项目 ID 并将其放入操作参数时遇到问题。到目前为止,我尝试了这些构造

<script id="rowTemplate" type="text/x-kendo-tmpl">
                <tr>
                    <td>
                    <form action="/Home/EditProduct/?id="+ "#=Id#" class="addEditButton" method="post">
                        <submit type="button" value="Edytuj"/>
                    </form>
                      </td>
                </tr>
    </script>

<script id="rowTemplate" type="text/x-kendo-tmpl">
                <tr>
                    <td>
                    <form action="/Home/EditProduct/?id="+ ${ Id } class="addEditButton" method="post">
                        <submit type="button" value="Edytuj"/>
                    </form>
                      </td>
                </tr>
    </script>

<script id="rowTemplate" type="text/x-kendo-tmpl">
                <tr>
                    <td>
                    <form action="/Home/EditProduct/?id=${ Id }"  class="addEditButton" method="post">
                        <submit type="button" value="Edytuj"/>
                    </form>
                      </td>
                </tr>
    </script> 

<script id="rowTemplate" type="text/x-kendo-tmpl">
                <tr>
                    <td>
                    <form action="/Home/EditProduct/?id=${ Id }  class="addEditButton" method="post">
                        <submit type="button" value="Edytuj"/>
                    </form>
                      </td>
                </tr>
    </script>

但是,此方法不能成功地从绑定到行的对象中检索 id 参数的值。是否有可能以某种方式将 id 的值传递给行动?

4

1 回答 1

0

我想这会回答你的问题。

http://andregelderblom.wordpress.com/2012/02/27/pass-kendoui-datagrid-variable-to-template-that-uses-zend-url/

于 2012-02-27T12:51:01.610 回答