kgrogers

Forum Replies Created

Viewing 15 replies - 1 through 15 (of 22 total)
  • Author
    Replies
  • in reply to: Set rowHeight with wrap #128046
    kgrogers
    Participant

    What is the secret to formatting code like you did in your post above? I did it once years ago and now can’t for the life of me figure out how to do it.

     

    Can you post a sticky post somewhere with instructions on how to post things like that in this forum?

    • This reply was modified 1 month, 2 weeks ago by kgrogers.
    • This reply was modified 1 month, 2 weeks ago by kgrogers.
    in reply to: Set rowHeight with wrap #128045
    kgrogers
    Participant

    Hi Will:

     

    I implemented the changes but I am getting an error.  Here is my index.php file:

    In my grid.php file I added the following:

    The error is reported in the developer console:

    Ken

    • This reply was modified 1 month, 2 weeks ago by kgrogers.
    • This reply was modified 1 month, 2 weeks ago by kgrogers.
    in reply to: PHP Suite v5.5.5 – Bootstrap Grid Defaults #128038
    kgrogers
    Participant

    Hi Will:

    Here is my code – most of it is from the Bootstrap 4 demo included in the 5.5.5 package.

    Notice that when the page loads, the grid isn’t taking up the full witdth of the div – if you resize the screen to be narrower than the grid, then resize it larger, the grid will then fill the div horizontally.

    For the vertical direction, I want the grid to fill the div, but I want the div to be a fixed size based on the viewport size with no scroll bar. The grid itself can have a scrollbar, and the bottom nav should always be visible at the bottom of the div.  Actually, it would be great if I could hide the bottom nav and only have the top nav, but I’m not sure that’s possible.

    index.php

    <?php
    require_once ‘../../jq-config.php’;
    // include the jqGrid Class
    require_once ABSPATH.”php/PHPSuito/jqGrid.php”;
    // include the driver class
    require_once ABSPATH.”php/PHPSuito/DBdrivers/jqGridPdo.php”;
    // Connection to the server
    $conn = new PDO(DB_DSN,DB_USER,DB_PASSWORD);
    // Tell the db that we use utf-8
    $conn->query(“SET NAMES utf8”);

    // Create the jqGrid instance
    $grid = new jqGridRender($conn);
    // Write the SQL Query
    $grid->SelectCommand = ‘SELECT OrderID, Freight, OrderDate, ShipCity FROM orders’;
    // Set output format to json
    $grid->dataType = ‘json’;
    // Let the grid create the model
    $grid->setColModel();
    // Set the url from where we obtain the data
    $grid->setUrl(‘grid.php’);
    // Set some grid options
    $grid->setGridOptions(array(
    “rowNum”=>10,
    “rowList”=>array(10,20,30),
    “sortname”=>”OrderID”
    ));
    // Change some property of the field(s)
    $grid->setColProperty(“OrderDate”, array(
    “formatter”=>”date”,
    “formatoptions”=>array(“srcformat”=>”Y-m-d H:i:s”,”newformat”=>”m/d/Y”),
    “search”=>false
    )
    );
    // Enable navigator
    $grid->navigator = true;
    // Enable excel export
    $grid->setNavOptions(‘navigator’, array(“excel”=>false,”add”=>true,”edit”=>true,”del”=>true,”view”=>true));
    // add a custom button via the build in callGridMethod
    // note the js: before the function
    $buttonoptions = array(“#pager”,
    array(“caption”=>”Pdf”, “title”=>”Export to Pdf”, “onClickButton”=>”js: function(){
    jQuery(‘#grid’).jqGrid(‘excelExport’,{tag:’pdf’, url:’grid.php’});}”
    )
    );
    $grid->callGridMethod(“#grid”, “navButtonAdd”, $buttonoptions);
    // Enjoy
    $grid->renderGrid(‘#grid’,’#pager’,true, null, null, true,true);

    grid.php

    <?php
    require_once ‘../../jq-config.php’;
    // include the jqGrid Class
    require_once ABSPATH.”php/PHPSuito/jqGrid.php”;
    // include the driver class
    require_once ABSPATH.”php/PHPSuito/DBdrivers/jqGridPdo.php”;
    // Connection to the server
    $conn = new PDO(DB_DSN,DB_USER,DB_PASSWORD);
    // Tell the db that we use utf-8
    $conn->query(“SET NAMES utf8”);

    // Create the jqGrid instance
    $grid = new jqGridRender($conn);
    // Write the SQL Query
    $grid->SelectCommand = ‘SELECT OrderID, Freight, OrderDate, ShipCity FROM orders’;
    // Set output format to json
    $grid->dataType = ‘json’;
    // Let the grid create the model
    $grid->setColModel();
    // Set the url from where we obtain the data
    $grid->setUrl(‘grid.php’);
    // Set some grid options
    $grid->setGridOptions(array(
    “rowNum”=>10,
    “rowList”=>array(10,20,30),
    “sortname”=>”OrderID”
    ));
    // Change some property of the field(s)
    $grid->setColProperty(“OrderDate”, array(
    “formatter”=>”date”,
    “formatoptions”=>array(“srcformat”=>”Y-m-d H:i:s”,”newformat”=>”m/d/Y”),
    “search”=>false
    )
    );
    // Enable navigator
    $grid->navigator = true;
    // Enable excel export
    $grid->setNavOptions(‘navigator’, array(“excel”=>false,”add”=>true,”edit”=>true,”del”=>true,”view”=>true));
    // add a custom button via the build in callGridMethod
    // note the js: before the function
    $buttonoptions = array(“#pager”,
    array(“caption”=>”Pdf”, “title”=>”Export to Pdf”, “onClickButton”=>”js: function(){
    jQuery(‘#grid’).jqGrid(‘excelExport’,{tag:’pdf’, url:’grid.php’});}”
    )
    );
    $grid->callGridMethod(“#grid”, “navButtonAdd”, $buttonoptions);
    // Enjoy
    $grid->renderGrid(‘#grid’,’#pager’,true, null, null, true,true);

     

    • This reply was modified 1 month, 4 weeks ago by kgrogers. Reason: can't figure out how to format code
    • This reply was modified 1 month, 4 weeks ago by kgrogers.
    in reply to: Change field size in edit/add form #127961
    kgrogers
    Participant

    Thank you Will- That’s exactly what I was looking for.

     

    Ken

    in reply to: Loading dynamically via ajax – with parameters #127955
    kgrogers
    Participant

    Hi Will:

    You nailed it – this is exactly what I was looking for  – It didn’t occur to me to look through the Searching/Filtering demos – Thank you so much for pointing me in the right direction.

     

    Ken

    in reply to: Documentation Update? #127952
    kgrogers
    Participant

    Thank you for the update Will. I know that keeping documentation up to date is pretty much always the last thing on the list, but, for me at least, it’s one of the most important things and should be a higher priority.

    Ken

    in reply to: Loading dynamically via ajax – with parameters #127951
    kgrogers
    Participant

    Will:

    Yes, that’s what I’d like to try and accomplish.

    For example, in your demo html file, somehow add in a parameter to only pull records from the table where the productID = 8. So when the button is clicked, the grid only shows that row from the table.

    Ken

    in reply to: Convert Insert to Update on Duplicate Primary Key #127208
    kgrogers
    Participant

    Thanks, Will.  That solved my problem.

    Ken

    in reply to: test #125333
    kgrogers
    Participant

    Thanks, Will – I’ll give it a try and let you know…

    in reply to: test #125323
    kgrogers
    Participant

    Hello Guriddo?  Anyone care to help me out here?

    in reply to: test #125301
    kgrogers
    Participant

    Will:

    The fact that the setSelect commands only is excuted once is the problem. In essence that means you can only filter the entire table on only one column at a time. In other words, in my code above, the initial table yeilds around 5,000 rows (no filters appliaed). The user selects an option from the Platform column, the table refreshes with only those platforms that match the selected option. However, the Location drop-down still contains all of the locations, whereas it should only contain those locations that match the selected Platform. And so on…
    What I am looking for is a way to filter the table based on all of the setSelects combined, in sequence of them being selected. I am sure it can be accomplished with javascript, I just can’t quite figure out how to do it. All of the examples in the forum for dependent drop-downs are for the editing forms – I want to make the setSelects (or some other javascript based method) dependent on each other simply to filter the table.

    • This reply was modified 6 years, 5 months ago by kgrogers.
    • This reply was modified 6 years, 5 months ago by kgrogers.
    in reply to: Show/Hide export button #124736
    kgrogers
    Participant

    Oh ok.  Let me try my last post above.  This is what I ended up doing to show/hide the export button based on the number of records returned:

    • This reply was modified 6 years, 10 months ago by kgrogers.
    in reply to: Export to Excel after Columns Chooser #124735
    kgrogers
    Participant

    Well heck  😉

    Thanks for the quick response and I am looking forward to the next release.

     

    Ken

    in reply to: Show/Hide export button #124722
    kgrogers
    Participant

    So I finally figured it out.  Here’s what I did that worked:

     

    I’d still like to know how to get code to show up as code after submitting a post though.

    Ken

    • This reply was modified 6 years, 10 months ago by kgrogers.
    • This reply was modified 6 years, 10 months ago by kgrogers.
    • This reply was modified 6 years, 10 months ago by kgrogers.
    • This reply was modified 6 years, 10 months ago by kgrogers.
    • This reply was modified 6 years, 10 months ago by kgrogers.
    • This reply was modified 6 years, 10 months ago by kgrogers.
    in reply to: Show/Hide export button #124721
    kgrogers
    Participant

    And if you could tell me how to show the code I posted as code I’d appreciate that too.

Viewing 15 replies - 1 through 15 (of 22 total)

Stay connected with us in your favorite flavor!