Alpha Video Training
Results 1 to 5 of 5

Thread: Checkbox in non-editable grid is editable?

  1. #1
    "Certified" Alphaholic Scott Emerick's Avatar
    Real Name
    Scott Emerick
    Join Date
    Dec 2000
    Location
    Central Virginia/ North Carolina Border
    Posts
    2,154

    Default Checkbox in non-editable grid is editable?

    Hi All,

    I have a non-editable grid based on a table which holds logical fields. I want to display the logical fields in the grid as checkboxes. When I change the control type from Label to Checkbox it displays properly, however, the checkbox is now able to be changed on the grid.

    How do I make this control read only?

    Thanks,

    Scott

  2. #2
    "Certified" Alphaholic NoeticCC's Avatar
    Real Name
    Andrea Gill
    Join Date
    Nov 2007
    Location
    Golcar, West Yorkshire, UK
    Posts
    2,070

    Default Re: Checkbox in non-editable grid is editable?

    A checkbox in HTML is by default enabled, however it is possible to disable it in Javascript(dynamically), or in HTML like so:

    <input type="checkbox" disabled name="C1" value="ON">
    It would be nice if this was automatically considered in Alpha5 when making a grid read only though...

    If you are just after a display of a checkbox, you might want to consider using a graphic instead, or a custom field with an if then else statement:

    Dim somevalue as L
    somevalue = data.fieldname

    if somevalue = .t. then
    checkstring = <<%htm%
    <input type="checkbox" disabled name="check[1]" value="Y" checked>%htm%
    else
    checkstring = <<%htm%
    <input type="checkbox" disabled name="check[1]" value="Y" checked>%htm%
    end if

    fieldname_rendered = checkstring

  3. #3
    "Certified" Alphaholic Scott Emerick's Avatar
    Real Name
    Scott Emerick
    Join Date
    Dec 2000
    Location
    Central Virginia/ North Carolina Border
    Posts
    2,154

    Default Re: Checkbox in non-editable grid is editable?

    Thanks Andrea,

    I had a feeling this was not a simple thing and thought about going with images.

    Thanks for your input and tip.

    Scott

  4. #4
    "Certified" Alphaholic NoeticCC's Avatar
    Real Name
    Andrea Gill
    Join Date
    Nov 2007
    Location
    Golcar, West Yorkshire, UK
    Posts
    2,070

    Default Re: Checkbox in non-editable grid is editable?

    Quote Originally Posted by Scott Emerick View Post
    Thanks Andrea,

    I had a feeling this was not a simple thing and thought about going with images.

    Thanks for your input and tip.

    Scott
    It might be an idea to submit this as a feature suggestion or bug fix, as it should be easy for Alpha to add an option to enable or disable HTML controls in read only grids... a simple graphic might be more elegant though as depending on someone's monitor the disabled control may not be easy to read as it gets greyed out.

  5. #5
    "Certified" Alphaholic
    Real Name
    Chris Tappan
    Join Date
    Jun 2009
    Location
    Marietta, GA
    Posts
    1,303

    Default Re: Checkbox in non-editable grid is editable?

    I couldn't find a request in the features wishlist related to this or the same behavior of radio buttons, but it just makes sense to me that if something's designed in A5 to be disabled, it is. Did either of you submit this as a bug or features request? Thanks.

Similar Threads

  1. DataSubmitted object and editable fields
    By moiola in forum Application Server Version 9 - Web/Browser Applications
    Replies: 8
    Last Post: 08-08-2008, 11:07 AM
  2. Using Custom Controls on an Editable Grid
    By Edward Larrabee in forum Web Application Server v7
    Replies: 0
    Last Post: 05-18-2006, 09:46 AM
  3. Auto Increment Field Editable???
    By Howard G. Cornett in forum Alpha Five Version 5
    Replies: 2
    Last Post: 04-28-2004, 07:25 AM
  4. Editable Drop Down Box
    By Gary Ryder in forum Alpha Five Version 5
    Replies: 3
    Last Post: 12-17-2003, 03:31 AM
  5. A list box with an editable column?
    By Daniel Weiss in forum Alpha Five Version 5
    Replies: 2
    Last Post: 01-22-2003, 05:55 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •