jQWidgets Forums

Forum Replies Created

Viewing 3 posts - 16 through 18 (of 18 total)
  • Author
    Posts
  • in reply to: Data from mySQL Data from mySQL #50121

    wfr
    Participant

    YES, YES, YES !!!!

    Thank you so much!

    Walter

    in reply to: Data from mySQL Data from mySQL #50112

    wfr
    Participant

    Hi Peter,

    My index.html looks now like this (according to your last post):

    <!DOCTYPE html> 
    <head> 
    <title>Title</title>
    <meta charset="utf-8">
    
    <link rel="stylesheet" 
        href="../../jqwidgets/jqwidgets/styles/jqx.base.css" type="text/css" />
        <link rel="stylesheet" 
        href="../../jqwidgets/jqwidgets/styles/jqx.darkblue.css" type="text/css" />
        <script type="text/javascript" src="../../jqwidgets/scripts/jquery-1.10.2.min.js"></script>
        <script type="text/javascript" src="../../jqwidgets/jqwidgets/jqx-all.js"></script>
    	
       
    <div id="jqxgrid"></div>
    
    <script>
    $(document).ready(function () {
    // prepare the data
    var source ={
    datatype: "json",
    datafields: [{ name: 'datum' },{ name: 'bank' },{ name: 'bank_wert' },{ name: 'zu_an' },{ name: 'zu_wert' },],
    { name: 'info_text' },{ name: 'info_wert' },{ name: 'bemerkungen' }
    url: 'data.php'
    };
    
    var dataAdapter = new $.jqx.dataAdapter(source);
    
    $("#jqxgrid").jqxGrid({
    source: dataAdapter,
    theme: 'classic',
    columns: [
    { text: 'Datum', datafield: 'datum', width: 100 },
    { text: 'Bank', datafield: 'bank', width: 100 },
    { text: 'Bank-Wert', datafield: 'bank_wert', width: 100 },
    { text: 'Zahlung unterwegs an', datafield: 'zu_an', width: 100 },
    { text: 'Zahlung unterwegs Wert', datafield: 'zu_wert', width: 100 },
    { text: 'Info-Text', datafield: 'info_text', width: 100 },
    { text: 'Info-Wert', datafield: 'info_wert', width: 100 },
    { text: 'Bemerkungen', datafield: 'bemerkungen', width: 100 }
    ]
    });
    });   
    </script>
       
       </body>
    </html>

    index.html, data.php and connect.php are in the same folder. Still no luck. But what about the index.php ?

    Thx
    Walter

    in reply to: Data from mySQL Data from mySQL #50096

    wfr
    Participant

    Thank you for your reply, Peter.
    I have tested the data.php as you’ve suggested. The data is shown:

    [{"datum":"2014-02-20","bank":"SPC","bank_wert":"230","zu_an":null,"zu_wert":"2054","info_text":"info","info_wert":"458","bemerkungen":"bemerkung"},{"datum":"2014-02-20","bank":"SPC","bank_wert":"-297125","zu_an":null,"zu_wert":"8954","info_text":null,"info_wert":null,"bemerkungen":null},{"datum":"2015-02-20","bank":"STP","bank_wert":"5431","zu_an":null,"zu_wert":null,"info_text":"info","info_wert":"145","bemerkungen":null},{"datum":"2015-02-20","bank":"SPC","bank_wert":"-254874","zu_an":null,"zu_wert":"894","info_text":"info","info_wert":"985","bemerkungen":"bemerkung"},{"datum":"2016-02-20","bank":"STP","bank_wert":"548","zu_an":null,"zu_wert":"897","info_text":null,"info_wert":null,"bemerkungen":null},{"datum":"2016-02-20","bank":"STP","bank_wert":"-784896","zu_an":null,"zu_wert":null,"info_text":null,"info_wert":null,"bemerkungen":null},{"datum":"2017-02-20","bank":"SPC","bank_wert":"874","zu_an":null,"zu_wert":"321","info_text":null,"info_wert":null,"bemerkungen":null},{"datum":"2017-02-20","bank":"STP","bank_wert":"-569212","zu_an":null,"zu_wert":"141","info_text":null,"info_wert":null,"bemerkungen":null}]

    So the data connection seems to be ok.

    You mentioned the index.php which I don’t have. What should be in there?

    As an additional suggestion – the Grid should be bound to a dataAdapter created from the source, not to the source object directly.

    Can you show how to do this based on my example?- sorry I’m a newbie.

    Thank’s again
    Walter

Viewing 3 posts - 16 through 18 (of 18 total)