Okay
  Public Ticket #3339306
pass var 1-9 from page 1 to page 3
Closed

Comments

  • Douglas Milligan started the conversation

    I have a variable passed from page 1 to 2, is there a way to get it to page 3?  I tried not specifying it in hopes it would remain as it was, but evidently it is getting cleared between pages.

  •  1,849
    Miloš replied

    Hi, Douglas.

    My apologies, but i can't seem to visualise or understand this exact use-case as you described it.

    Are you passing a variable through the table's shortcodes between 3 pages, or perhaps passing a variable via URL parameters for filtering?

    Would it be possible to show us more details how you managed to achieve that between pages 1 and 2 - and show us what is needed for page 3 , and we can advise more.

    Best will be if you could make a screen recording to show us this use-case.

    If there is any confidential data, please send a PRIVATE reply, for safety reasons.

    Thank you.

    Kind Regards, 

    Miloš Jovanović
    [email protected]

    Rate my support

    Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables

  • Douglas Milligan replied

    I have the following working fine using code for page 2 and page 3 (see below).  What I would like to do is to eliminate all the code and use only wpdatatables options, see info after all code.......


    page 1 has 5 buttons, stage 1-5

    user selects a stage, say stage 1,  that uses the following link to move to page 2 that displays all rows with stage = 1 and input = y

            http://douglasm83.sg-host.com/menengroup/test-variables/?url_stage=1

    page 2 is displayed using the code for page 2 below:

          session_start(); 

          $url_stage = absint( $_GET['url_stage'] );

          $input_1 = 'y';

          $run_1 = "[wpdatatable id=2 var1='$url_stage' var2='$input_1']";

          if ($url_stage == "1") : echo  do_shortcode($run_1);

    page 3 is displayed after the user edits 1 column in all rows displayed on page 2, see code for page 3 below:

         session_start();

         $url_stage = $_SESSION['url_stage'];

          $input_1 = '%'; 

          $run_1 = "[wpdatatable id=2 var1='$url_stage' var2='$input_1']";

         if ($url_stage == "1") : echo do_shortcode($run_1);


    Summary:  on page 1 user selects a stage, page 2 displays rows with stage = user selected from page 1 and input = y,

     user edits values on page 2 and clicks link to page 3, page 3 displays rows with stage still = user selected from                      page 1, but this time input = '%" (all input rows, could be input = y or n instead of all rows);  before displaying                          page 3, some code to be written in C(+/++) is called and calculations performed for rows where input = n not y,                      as these are the rows the user has already edited


    code for page 2

    --------------------------------------------

    <?php

    if ( isset( $_GET['url_stage'] ) ) :
    $url_stage = absint( $_GET['url_stage'] );
    else :
    console_log("url_stage was not passed in the url");
    endif;

    session_start(); 

    $_SESSION['url_stage'] = $url_stage;
    $stage_set = $_SESSION['url_stage'];

    console_log("url_stage is: $url_stage");
    console_log("stage_set is: $stage_set");

    $input_1 = 'y';

    $run_1 = "[wpdatatable id=2 var1='$url_stage' var2='$input_1']";

    if ($url_stage == "1") :
    console_log("url_stage is: $url_stage");
    console_log("stage 1 is: $stage_1");
    echo do_shortcode($run_1);
    elseif ($url_stage == "2") :
    echo do_shortcode($run_1);
    elseif ($url_stage == "3") :
    echo do_shortcode($run_1);
    elseif ($url_stage == "4") :
    echo do_shortcode($run_1);
    elseif ($url_stage == "5") :
    echo do_shortcode($run_1);
    else : 
    console_log("ERROR - stage_to_use is not between 1-5");
    endif;

    function console_log($output, $with_script_tags = true) {
    $js_code = 'console.log(' . json_encode($output, JSON_HEX_TAG) . 
    ');';
    if ($with_script_tags) {
    $js_code = '<script>' . $js_code . '</script>';
    }
    echo $js_code;
    }

    ?>


    code for page 3

    ----------------------------------------------------------

    <?php
    session_start();

    $url_stage = $_SESSION['url_stage'];

    console_log("url_stage is: $url_stage");

    $input_1 = '%';

    $run_1 = "[wpdatatable id=2 var1='$url_stage' var2='$input_1']";

    if ($url_stage == "1") :
    console_log("url_stage is: $url_stage");
    console_log("stage 1 is: $stage_1");
    echo do_shortcode($run_1);
    elseif ($url_stage == "2") :
    echo do_shortcode($run_1);
    elseif ($url_stage == "3") :
    echo do_shortcode($run_1);
    elseif ($url_stage == "4") :
    echo do_shortcode($run_1);
    elseif ($url_stage == "5") :
    echo do_shortcode($run_1);
    else : 
    console_log("ERROR - stage_to_use is not between 1-5");
    endif;

    function console_log($output, $with_script_tags = true) {
    $js_code = 'console.log(' . json_encode($output, JSON_HEX_TAG) . 
    ');';
    if ($with_script_tags) {
    $js_code = '<script>' . $js_code . '</script>';
    }
    echo $js_code;
    }

    ?>



    --------------------------------------------------------------------------------------------------------------------------------------------------------------------


    What I am trying to do to eliminate all code..............................................


    page 1 has 5 buttons, stage 1-5

    user selects a stage, say stage 1,  that uses the following link to move to page 2 that displays all rows with stage = 1 and input = y

            http://douglasm83.sg-host.com/menengroup/test-variables/?wdt_column_filter[stage]=1&wdt_column_filter[input]=y

    page 2 displays the info with 1 column set to editable, column "value", no code needed, tried the following hoping that stage would not be reset and would use stage passed to page 2,  NOTE, I can't use the url as above since the stage might be 1-5.  I need a way to pass stage from page 2 to page 3

            http://douglasm83.sg-host.com/menengroup/test-all/?wdt_column_filter[input]=%

    QUESTION:

    How to get page 3 display using no code and the stage passed from page 1 with input = y or n (or use '%')??????????

    I would like to be able to say input = n or y instead of '%^' in case a row slips through editing and makes it to the database with some other value.

    I hope this explains it better and you understand what I am trying to accomplish, use NO CODE just options inside wpdatatables.


  • Douglas Milligan replied

    Sorry, I thought I would add my other ticket info here since it applies to the same application.

    When page 2 is displayed, the user will edit 1 column on several rows.

    When page 3 is displayed, I would like the column that was edited on page 2 to be set to non-editable.

  • Douglas Milligan replied

    page 1

    “STAGE” to run     1   2   3  4  5

    page 2

    Calculate followed by table showing all rows where stage = used selected 1-5 and input = y with 1 column editable

    page 3

    RETURN to "STAGE" followed by table showing all rows where stage still = user selected 1-5 and input = y or n and column no longer editable


  •  1,849
    Miloš replied

    Hi, Douglas.

    Thank you for passing the additional explanations and details about the use-case that you wish to achieve.

    To be honest i am not 100% sure if something like this will be possible with our plugin,

    with our current capabilities,  so i will check with our senior 2nd Level Team.

    As soon as they advise i will report back right away - and we will let you know if any further clarification is needed.

    Thank you for your patience.

    Kind Regards, 

    Miloš Jovanović
    [email protected]

    Rate my support

    Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables

  •  1,849
    Miloš replied

    Hi, Douglas.

    We have checked, and i am sorry to disappoint you, but

    at this time, we don't have any built-in solution to achieve this, but you can suggest it to our developers - they will do their best to make a solution in the future.

    Please feel free to search on our suggestions page

     to see if someone may be already suggested this feature. If you can't see it, feel free to add your suggestion there,  and as more people vote, the feature will move higher on the priority list.

    You can certainly follow our changeLog page if you'd like ( it is also available in the plugin dashboard), where we state any changes/new features/bug fixes during updates;

    and our newsletter, so you're informed about new features, bug fixes, freebies, etc.

    -

    If you have coding skills and wish to try to make a custom solution now,

    you can check out our available hooks for Developers on this documentation and see if you can find any hook that might help.

    Please be advised that custom solutions with hooks are not included in our support.

    You can also research resources such as Stack Overflow to see if any other user perhaps found a workaround.

    ( We do like to give examples for certain solutions, but for this use-case, we, unfortunately, don't have anything yet)

    Kind Regards, 

    Miloš Jovanović
    [email protected]

    Rate my support

    Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables

  • Douglas Milligan replied

    Since there is not a solution, you may close this ticket.

  •  1,849
    Miloš replied

    Hi, Douglas.

    We will close the ticket,

    but of course, please don't hesitate to open new tickets if any new question comes up, we will do our best to advise.

    Thank you.

    Kind Regards, 

    Miloš Jovanović
    [email protected]

    Rate my support

    Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables