[CLOSED] Set button enable true or false MVC

  1. #1

    [CLOSED] Set button enable true or false MVC

    My Button code

     Html.X().Button()
    .ID("btnEdit")
      .Text("Edit record")
    .Icon(Icon.ApplicationEdit)
    .Disabled(_PagePermission.Permission_Edit)
    .DirectEvents(de =>
                 {
                     de.Click.Action = "Edit";
                     de.Click.EventMask.ShowMask = true;
                     de.Click.ExtraParams.Add(new Parameter()
                     {
                         Name = "selected",
                         Value = "App.GridPanel1.getSelectionSubmit().getSelectionModelField().getValue()",
                         Mode = ParameterMode.Raw
                     });
                 })

    currently I do if Permission_Edit is false then I convert it to true and if Permission_Edit true then I convert it to false,I not get any example to do this with Enable property of button.

    please help me to do this with enable property
    Last edited by Daniil; Jun 17, 2014 at 11:40 AM. Reason: [CLOSED]
  2. #2
    Hi @matrixwebtech,

    Please clarify do you want the Button not to be on the view at all if _PagePermission.Permission_Edit is false?

    If so, then do not add the Button on the view at all.

    Or, maybe, you just need this.
    .Disabled(!_PagePermission.Permission_Edit)

Similar Threads

  1. Replies: 3
    Last Post: Jun 25, 2013, 3:17 PM
  2. [CLOSED] Checkbox return true/false
    By Jurke in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Oct 04, 2011, 5:42 AM
  3. Replies: 0
    Last Post: May 04, 2010, 7:08 AM
  4. [CLOSED] textbox visible false&true
    By speedstepmem4 in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Mar 16, 2009, 9:57 AM
  5. Replies: 3
    Last Post: Jan 29, 2009, 5:32 PM

Tags for this Thread

Posting Permissions