sagana

Forum Replies Created

Viewing 14 replies - 46 through 59 (of 59 total)
  • Author
    Replies
  • in reply to: Date format in search dialog #126484
    sagana
    Participant

    No longer so sure about this. It actually looks more like the result from the search dialog re does the select on the database so it would be relevant to have the datepicker convert the date back to Y-m-d for the search which does not seem to be happening.

    in reply to: Date format in search dialog #126483
    sagana
    Participant

    Please ignore this. I realise the question is irrelevant as the the search is on dates in the grid which are formatted as d/m/Y and not searching the dates in the database format.

    in reply to: Datepicker in search dialog #126478
    sagana
    Participant

     

    Thank you. Now working

    in reply to: Drag to multiple grids #126470
    sagana
    Participant

    After trial and error and an old post this works:

    In A – jQuery(‘A’).jqGrid(‘gridDnD’,{connectWith:’B,C’});

    In B – jQuery(‘A’).jqGrid(‘gridDnD’,{connectWith:’A,B,C’});

    In C – jQuery(‘A’).jqGrid(‘gridDnD’,{connectWith:’A,B,C’});

    in reply to: Drag and drop between grids #126467
    sagana
    Participant

    I have it now working. It appears not to like jQuery version 3. changed to 2.1 like demo and it works.

    in reply to: Pass parameter to main grid for sql where clause #126463
    sagana
    Participant

    Many thanks indeed. That is working.

    in reply to: Pass parameter to main grid for sql where clause #126457
    sagana
    Participant

    Hi Will, thank you for your replies. Unfortunately it is not working.

    <?php

    include_once ‘jq-config.php’;

    // include the jqGrid Class
    require_once “../javascript/jqgrid/php/jqGrid.php”;
    // include the PDO driver class
    require_once “../javascript/jqgrid/php/jqGridPdo.php”;

    if(!isset($TestID) ) {
    $TestID = jqGridUtils::GetParam(‘id’);
    }

    $id = $TestID;

    // Connection to the server
    $conn = new PDO(DB_DSN,DB_USER,DB_PASSWORD);

    // Create the jqGrid instance
    $grid = new jqGridRender($conn);

    // options
    $grid->setGridOptions(array(“id”=>$TestID));

    // the actual query for the grid data
    $grid->SelectCommand = “SELECT
    tr_cyotestquestion.TestID,
    tr_cyotestquestion.FixedOrder,
    tr_cyoquestion.Title,
    tr_cyoquestion.CYOQuestionID
    FROM
    tr_cyoquestion
    INNER JOIN tr_cyotestquestion ON tr_cyotestquestion.CYOQuestionID = tr_cyoquestion.CYOQuestionID
    WHERE
    tr_cyotestquestion.FixedOrder IS NOT NULL and
    tr_cyotestquestion.TestID = “.$id;

    gives the error:- Syntax error or access violation 1064. Error in SQL syntax near ” ….

    <?php

    include_once ‘jq-config.php’;

    // include the jqGrid Class
    require_once “../javascript/jqgrid/php/jqGrid.php”;
    // include the PDO driver class
    require_once “../javascript/jqgrid/php/jqGridPdo.php”;

    if(!isset($TestID) ) {
    $TestID = jqGridUtils::GetParam(‘id’);
    }

    $id = $TestID;

    // Connection to the server
    $conn = new PDO(DB_DSN,DB_USER,DB_PASSWORD);

    // Create the jqGrid instance
    $grid = new jqGridRender($conn);

    // options
    $grid->setGridOptions(array(“id”=>$TestID));

    // the actual query for the grid data
    $grid->SelectCommand = “SELECT
    tr_cyotestquestion.TestID,
    tr_cyotestquestion.FixedOrder,
    tr_cyoquestion.Title,
    tr_cyoquestion.CYOQuestionID
    FROM
    tr_cyoquestion
    INNER JOIN tr_cyotestquestion ON tr_cyotestquestion.CYOQuestionID = tr_cyoquestion.CYOQuestionID
    WHERE
    tr_cyotestquestion.FixedOrder IS NOT NULL and
    tr_cyotestquestion.TestID = ?”;

    gives the error:- Invalid parameter number: no parameters were bound ….

    Sorry to trouble you with this but I am obviously missing the point somewhere as there must be a way of passing variables to the select statement for the grid.

    Regards

    Murray

    in reply to: Pass parameter to main grid for sql where clause #126451
    sagana
    Participant

    Many thanks for your prompt reply, however neither suggestion works. jqGrid refuses to recognise the variable TestID on the second pass.

    either using: // Set the url from where we obtain the data
    $grid->setUrl(‘getTestQuestionsFO.php?id=’.$TestID);

    or

    <?php

    include_once ‘jq-config.php’;

    // include the jqGrid Class
    require_once “../javascript/jqgrid/php/jqGrid.php”;
    // include the PDO driver class
    require_once “../javascript/jqgrid/php/jqGridPdo.php”;

    if(!isset($TestID) ) {
    $TestID = jqGridUtils::GetParam($TestID);
    }

    $id = $TestID;

    // Connection to the server
    $conn = new PDO(DB_DSN,DB_USER,DB_PASSWORD);

    // Create the jqGrid instance
    $grid = new jqGridRender($conn);

    // options
    //$grid->setGridOptions(array(“id”=>$TestID));

    // the actual query for the grid data
    $grid->SelectCommand = “SELECT
    tr_cyotestquestion.TestID,
    tr_cyotestquestion.FixedOrder,
    tr_cyoquestion.Title,
    tr_cyoquestion.CYOQuestionID
    FROM
    tr_cyoquestion
    INNER JOIN tr_cyotestquestion ON tr_cyotestquestion.CYOQuestionID = tr_cyoquestion.CYOQuestionID
    WHERE
    tr_cyotestquestion.FixedOrder IS NOT NULL and
    tr_cyotestquestion.TestID = “.$id;

    // set the ouput format to json
    $grid->dataType = ‘json’;

    // Let the grid create the model
    $grid->setColModel(null);

    // Set the url from where we obtain the data
    $grid->setUrl(‘getTestQuestionsFO.php’);

    // Set some grid options
    $grid->setGridOptions(array(
    “caption”=>”Fixed Order questions for Test “,
    “rowNum”=>20,
    “sortname”=>”FixedOrder”,
    “altRows”=>true,
    “rowList”=>array(20,100,200),
    “height”=>250,
    “width”=>400
    ));

    $grid->addCol(array(“name”=>”act”),”last”);

    // Change some property of the field(s)
    $grid->setColProperty(“TestID”, array(“label”=>”ID”, “width”=>25));
    $grid->setColProperty(“FixedOrder”, array(“label”=>”FixedOrder”, “width”=>25, “hidden”=>true));
    $grid->setColProperty(“Title”, array(“label”=>”Title”, “width”=>200));
    $grid->setColProperty(“CYOQuestionID”, array(“label”=>”CYOQuestionID”, “width”=>20, “hidden”=>true));
    $grid->setColProperty(“act”, array(“label”=>”Actions”, “width”=>50));

    $loadevent = <<<LOADCOMPLETE
    function(rowid){
    var ids = jQuery(“#qfolist”).getDataIDs();
    for(var i=0;i<ids.length;i++){
    var rowd = $(“#qfolist”).getRowData(ids);
    var cl = ids;
    sh = ‘</ids>’;

    jQuery(“#qfolist”).setRowData(ids,{act:sh});
    }
    }
    LOADCOMPLETE;

    $grid->setGridEvent(“loadComplete”,$loadevent);

    // Enable navigator
    $grid->navigator = true;
    // Disable some actions
    $grid->setNavOptions(‘navigator’, array(“excel”=>false,”add”=>false,”edit”=>false,”del”=>false,”view”=>false));

    // Run the script
    $grid->renderGrid(‘#qfolist’,’#qfopager’,true, null,null,true,true,true);
    $conn = null;

    ?>

    I have also tried Tony’s suggested

    $grid->renderGrid(‘#qfolist’,’#qfopager’,true, array($id),null,true,true,true);

    with $grid->setColModel(null,array($id));

    Any idea what I am doing wrong?

     

     

    in reply to: Subgrid empty #115125
    sagana
    Participant

    Thank you Tony, capitilsation changed and reserved from and to changed and it all works.

    Regards
    Murray

    in reply to: a.browser undefined #101850
    sagana
    Participant

    I reloaded all the js libraries and the issue seems to have dissapeared.

    in reply to: Northwind example database #100040
    sagana
    Participant

    Sorry about the miss-named table, however the Northwind database that came with my download of jqsuite has the following tables:-

    Categories, customes,employees,orders,order_details,products,shippers and suppliers but no nested_category.

    in reply to: Northwind example database #100035
    sagana
    Participant

    Specifically where can I find documentation on what values should be in lft, rgt fields in the table in setTableConfig? Level is fairly obvious.

    in reply to: Subgrid not displaying data #98066
    sagana
    Participant

    I have the subgrid working in other sites and see the json returned is in the same format as I describe above so I am stumped as to why it is not working here. Besides, the only control I have over the json produced is to tell the grid $grid->dataType = 'json'; . I cannot see what is different that is stopping it from working.

    in reply to: Add edit icon to ClientSide data array #88384
    sagana
    Participant

    act: be+”        “+se,

Viewing 14 replies - 46 through 59 (of 59 total)

Stay connected with us in your favorite flavor!