Alpha Video Training
Results 1 to 14 of 14

Thread: Select and Delete Multiple records with a check box

  1. #1
    Member
    Real Name
    Robert Brown
    Join Date
    Mar 2008
    Location
    Sydney
    Posts
    53

    Default Select and Delete Multiple records with a check box

    Hi

    My requirement is:

    i have a grid and each row of grid got checkbox.
    i need to check all checkbox when a checkbox(which placed inside or outside grid, preferably inside grid as a column name CHECKALL) is checked.

    i need exactly like checkall option in our personal mail inbox which will allow us to do multiple selection in one check.

    Thanks For any help.
    Robert.

  2. #2
    Moderator Steve Workings's Avatar
    Real Name
    Steve Workings
    Join Date
    Apr 2000
    Location
    The Dreaded Chair
    Posts
    5,592

    Default Re: Select and Delete Multiple records with a check box

    That'll take a bit of javascript. There are plenty of javascript functions out there to do what you want. A little google searching should find something that suits you.
    -Steve


  3. #3
    Member
    Real Name
    Robert Brown
    Join Date
    Mar 2008
    Location
    Sydney
    Posts
    53

    Default Re: Select and Delete Multiple records with a check box

    Yes, i achieved that with the help of JavaScript

    Thanks
    Robert

  4. #4
    Member
    Real Name
    Tom Williams
    Join Date
    Oct 2007
    Posts
    424

    Default Re: Select and Delete Multiple records with a check box

    Quote Originally Posted by robert brown View Post
    Yes, i achieved that with the help of JavaScript

    Thanks
    Robert

    Robert,

    Can you share your new found discovery so that others can benefit from that knowledge? At least a link!

    Tom

  5. #5
    Member
    Real Name
    Denis Ahmet
    Join Date
    Jul 2005
    Location
    United Kingdom
    Posts
    988

    Default Re: Select and Delete Multiple records with a check box

    Robert,

    I am also very interested in achieving this.

    Can you put your solution on the forum. The javascripts interfacing with the grid component would be very useful.

    Denis

  6. #6
    VAR Pat Bremkamp's Avatar
    Real Name
    Pat Bremkamp
    Join Date
    Apr 2000
    Location
    Oregon, USA
    Posts
    2,594

    Default Re: Select and Delete Multiple records with a check box

    I believe there is a sample that does just this in the web application samples that Alpha provides.

    Pat

  7. #7
    Member
    Real Name
    Denis Ahmet
    Join Date
    Jul 2005
    Location
    United Kingdom
    Posts
    988

    Default Re: Select and Delete Multiple records with a check box

    Pat,

    Thank you for your reply.

    I keep loosing the web location of the samples. Can you give me the URL for the latest set. If you have them....

    Thanks,


    Denis

  8. #8
    VAR Pat Bremkamp's Avatar
    Real Name
    Pat Bremkamp
    Join Date
    Apr 2000
    Location
    Oregon, USA
    Posts
    2,594

    Default Re: Select and Delete Multiple records with a check box

    When you first start A5, the database list allows you to look at sample and tutorial databases. Select the web page demo off there. The page allows you to change where they are copied, so a location I give you may not be correct.

    Pat

  9. #9
    Member
    Real Name
    Denis Ahmet
    Join Date
    Jul 2005
    Location
    United Kingdom
    Posts
    988

    Default Re: Select and Delete Multiple records with a check box

    Thanks Pat.

    I am aware of the local one's, it was just that i didnt have my development laptop with me. No worries, thanks for the pointer, I will check it out when i get back.

    Thanks again.

    Denis

  10. #10
    Member
    Real Name
    Robert Brown
    Join Date
    Mar 2008
    Location
    Sydney
    Posts
    53

    Default Re: Select and Delete Multiple records with a check box

    Quote Originally Posted by robert brown View Post
    Hi

    My requirement is:

    i have a grid and each row of grid got checkbox.
    i need to check all checkbox when a checkbox(which placed inside or outside grid, preferably inside grid as a column name CHECKALL) is checked.

    i need exactly like checkall option in our personal mail inbox which will allow us to do multiple selection in one check.

    Thanks For any help.
    Robert.
    Hi the solution for the above problem ,

    First to create "CHECK ALL" option i grid. I created that using HTML in the Freeform Layout of the grid,
    the code is
    <input type="checkbox" value="Approval" id="tryme" ></input>

    After creating the checkbox in the freeform layout
    I used java script , As i have to do make all checkbox true on selection of "CHECK ALL". Iam executing the loop "Count" times, Count is the total number of records in the grid. Iam iam finding before the javascript in XBASIC
    Hope what is explained is clear

    <script>

    window.onload = init;
    function init(){
    var counts = <%a5 ?count %>;
    var thistxt = document.getElementById("tryme")
    var myval = thistxt.value;
    thistxt.onclick = chkall
    function chkall(){
    for (i=1;i<=counts;i++)
    {
    var lvl = "V.R"+i+".status";
    if (thistxt.checked==true)
    {
    document.getElementById(lvl).checked = true}
    else{
    document.getElementById(lvl).checked = false}
    }}}
    </script>



    Thank you
    Robert

  11. #11
    Member
    Real Name
    Denis Ahmet
    Join Date
    Jul 2005
    Location
    United Kingdom
    Posts
    988

    Default Re: Select and Delete Multiple records with a check box

    Robert,

    Thank you for your response.

    I am trying to use this code, but I think I am getting stuck on where I would point the checkall to.

    I have two colums of checkboxes, (1) CHK1 and (2) CHK2. These are shown as fields within the grid component. Therefore every record will have the two checkboxes by there side.

    This is where i think i am going wrong.... I have placed

    Code:
    <input type="checkbox" value="Approval" id="tryme" ></input>
    in the FREEFORM Edit Regions (Above Grid) section, which gives me a check box above the grid results. I then placed the javascript directly below the checkbox code.

    Code:
    <html><head><title></title>
    <link rel="stylesheet" type="text/css" href="file:///C:\Program Files\A5V8/css/Page1/style.css ">
    </head>
    <body  class="Page1 PageBODY">
    <font size=2>Level 2 Items</font>
    
    <input type="checkbox" value="Approval" id="tryme" ></input>
    
    <script>
    window.onload = init;
    function init(){
    var counts = <%a5 ?count %>;
    var thistxt = document.getElementById("tryme")
    var myval = thistxt.value;
    thistxt.onclick = chkall
    function chkall(){
    for (i=1;i<=counts;i++)
    {
    var lvl = "V.R"+i+".status";
    if (thistxt.checked==true)
    {
    document.getElementById(lvl).checked = true}
    else{
    document.getElementById(lvl).checked = false}
    }}}
    </script>
    </body>
    When i check the newly created single checkbox, my other checkboxes do not get checked. Now I know the obvious reason is probably because I have not specified in code what to check when this is selected.

    Could you help me futher with this?

    Thanks in advance.

    Denis

  12. #12
    Member
    Real Name
    Robert Brown
    Join Date
    Mar 2008
    Location
    Sydney
    Posts
    53

    Default Re: Select and Delete Multiple records with a check box

    Quote Originally Posted by den1s View Post
    Robert,

    Thank you for your response.

    I am trying to use this code, but I think I am getting stuck on where I would point the checkall to.

    I have two colums of checkboxes, (1) CHK1 and (2) CHK2. These are shown as fields within the grid component. Therefore every record will have the two checkboxes by there side.

    This is where i think i am going wrong.... I have placed

    Code:
    <input type="checkbox" value="Approval" id="tryme" ></input>
    in the FREEFORM Edit Regions (Above Grid) section, which gives me a check box above the grid results. I then placed the javascript directly below the checkbox code.

    Code:
    <html><head><title></title>
    <link rel="stylesheet" type="text/css" href="file:///C:\Program Files\A5V8/css/Page1/style.css ">
    </head>
    <body  class="Page1 PageBODY">
    <font size=2>Level 2 Items</font>
    
    <input type="checkbox" value="Approval" id="tryme" ></input>
    
    <script>
    window.onload = init;
    function init(){
    var counts = <%a5 ?count %>;
    var thistxt = document.getElementById("tryme")
    var myval = thistxt.value;
    thistxt.onclick = chkall
    function chkall(){
    for (i=1;i<=counts;i++)
    {
    var lvl = "V.R"+i+".status";
    if (thistxt.checked==true)
    {
    document.getElementById(lvl).checked = true}
    else{
    document.getElementById(lvl).checked = false}
    }}}
    </script>
    </body>
    When i check the newly created single checkbox, my other checkboxes do not get checked. Now I know the obvious reason is probably because I have not specified in code what to check when this is selected.

    Could you help me futher with this?

    Thanks in advance.

    Denis
    Hi Denis
    I think you had placed Javascript in the HTML part that is in the freeform layout. You have to place javascript in the boby part of .a5w web page. And count u better initialise as 3 or 4 something likt that in the starting..
    Try this and let me know.
    Robert

  13. #13
    Member
    Real Name
    Denis Ahmet
    Join Date
    Jul 2005
    Location
    United Kingdom
    Posts
    988

    Default Re: Select and Delete Multiple records with a check box

    Hi Robert,

    Thank you for your time with this.

    I have now placed the javascript into the body section of the a5w page. Where in the code do i specify which checkboxes to check when i select check all?

    Thanks,

    Denis

  14. #14
    Member
    Real Name
    Robert Brown
    Join Date
    Mar 2008
    Location
    Sydney
    Posts
    53

    Default Re: Select and Delete Multiple records with a check box

    ok so.. now u placed the javascript in the a5w page. Good.

    No go through the java script code once more properly, as u have to make bit changes in that. i will explain u . Please look the codes below in red colour font ok.

    --- 1----assign count = 5
    --- 2----tryme is my check box that i placed in the free form layout's name,
    --- 3---- and i mentioned lvl as V.R"+i+, .. this means V.R.1 is ur first grid check box, V.R.2 will be ur second, V.R.3 will be ur thrid like that.. u please go through the HTML and Xbasic script of the grid, u can c "V.R..." If you read this javascript arleast 3 or 4 times perfectly u will get a good idea. And tell me the result ok..



    <script>
    window.onload = init;
    function init(){
    var counts =5;
    var thistxt = document.getElementById("tryme")
    var myval = thistxt.value;
    thistxt.onclick = chkall
    function chkall(){
    for (i=1;i<=counts;i++)
    {
    var lvl = "V.R"+i+".status";if (thistxt.checked==true)
    {
    document.getElementById(lvl).checked = true}
    else{
    document.getElementById(lvl).checked = false}
    }}}
    </script>
    </body>



    Robert

Similar Threads

  1. select multiple records with check boxes?
    By Peter.Greulich in forum Web Application Server v7
    Replies: 14
    Last Post: 08-08-2016, 05:45 PM
  2. Replies: 8
    Last Post: 02-12-2007, 02:43 PM
  3. Using check box-list box for multiple query
    By trackmanpete in forum Alpha Five Version 7
    Replies: 5
    Last Post: 01-30-2007, 04:15 PM
  4. Update Errors Other user and delete check box
    By peteconway in forum Alpha Five Version 7
    Replies: 0
    Last Post: 11-08-2005, 08:47 PM
  5. Xdialog check box list: single select option
    By Jim Chapman in forum Archived Wishlist
    Replies: 6
    Last Post: 10-21-2005, 01:51 PM

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
  •