0

需要设置按钮的一些属性。例如“已检查”。我想这很简单,但我无法处理它。请给个平安的建议。

 Html.DevExpress().Button(
                   btnSettings =>
                   {
                       btnSettings.Name = "Details";
                       btnSettings.Text = "";
                       btnSettings.ClientSideEvents.Click = "function (s,e){Details.Checked = true}";
                       btnSettings.ControlStyle.CssClass = "button";
                       btnSettings.ToolTip = "details";
                       btnSettings.UseSubmitBehavior = false;
                       btnSettings.AllowFocus = false;
                       btnSettings.Width = 1;
                       btnSettings.Height = 1;
                   }
               )
               .Render();
4

1 回答 1

1

来自devexpress 在线文档

<script type="text/javascript">
    function button1_CheckedChanged(s, e) {
        if (s.GetChecked()) {
            button2.SetEnabled(false);
            s.SetText("Enable Button");
        } else {
            button2.SetEnabled(true);
            s.SetText("Disable Button");
        }
    }
</script>

<table>
    <tr>
        <td>
            <% 
                Html.DevExpress().Button(
                    settings => {
                        settings.Name = "button1";

                        settings.Text = "Disable Button";
                        settings.Width = 120;
                        settings.GroupName = "FakeGroup";
                        settings.ClientSideEvents.CheckedChanged = "button1_CheckedChanged";
                    }
                )
                .Render();
            %>
        </td>
        <td></td>
        <td>
            <% 
                Html.DevExpress().Button(
                    settings => {
                        settings.Name = "button2";
                        settings.EnableClientSideAPI = true;
                    }
                )
                .Render();
            %>        
        </td>
    </tr>
</table>
于 2012-06-15T08:40:10.583 回答