0

I have Html 5 builder XE5 and installed the jqGrid from YouTUbe how to Moreover I found an answer to my problem at Answer but when I add this to my H5B I get no reaction at the document.write line on a new page. WHat do I wrong? I my jqGrid not the same for what that answer is? My code looks like this:

   function jqgrid1JSDblClickRow($sender, $params)

   {

    ?>
    //begin js

        var grid = $("#jqGrid");
        var rowKey = grid.getGridParam("selrow");

        if (rowKey)
            alert("Selected row primary key is: " + rowKey);
        else
            alert("No rows are selected");

    //end
    <?php
    }

the fabove function is a JS event function at OnDblClickRow at my jqgrid. I am a little bit confused. COuld any help me please? Thanks

Edit: Now always comes "No rows are selected", even when I select a row.

Walter Schrabmair
  • 1,251
  • 2
  • 13
  • 26
  • You shouldn't use `document.write()` after the page has been fully rendered. It will overwrite the page. You should use DOM modification functions. – Barmar Mar 03 '15 at 05:58
  • @Bamar thanks, but its only for testing. I would like to get the colDATA for a new SQL Select. It should display more details to the selected data item in the grid. How can I do this - I am totally newbee. Thanks a lot! – Walter Schrabmair Mar 03 '15 at 06:03
  • If you need to do another SQL select, you need to do an AJAX call to the server. If you want to display this in a subgrid, jQgrid has built-in methods for that, see the jQgrid web site for details. – Barmar Mar 03 '15 at 06:06
  • This is the event **handler** for a possible double click event. Have you attached this handler to an event? Please show where you have defined the jqGrid event **listener** – jasonscript Mar 03 '15 at 06:23
  • @jasonscript I do that in HTML 5 Builder, and the handler is filled in to the OnDblClickRow proterty. when I delete the 3 var lines and write document.write('Hi'); then the Hi is written properly. I though I could use the Answer to get the selected "PZeile" data. – Walter Schrabmair Mar 03 '15 at 06:54
  • @Barmar thanks, but is my jqGrid I downloaded from the mentioned site compatible to your jQgrid? Are there different products? Or all jqGrid the same? – Walter Schrabmair Mar 03 '15 at 06:55
  • I think it's unlikely that there are two different widgets both called jQgrid. They might just be different versions. – Barmar Mar 03 '15 at 06:57
  • That site is talking about `DBgrid`, not `jQgrid`. – Barmar Mar 03 '15 at 06:58
  • @Barmar yes I think so too. Could you explain me what var grid = $("#jqGrid"); mean? Can I access so the jqGrid component in HTML 5 BUilder ? – Walter Schrabmair Mar 03 '15 at 07:19
  • `$("#jqGid")` is a jQuery call that returns the element with `id="jqGrid"`. It then assigns this to the `grid` variable. I don't know anything about HTML5 Builder, I've never heard of it before now. – Barmar Mar 03 '15 at 07:21

0 Answers0