jQWidgets Forums

Forum Replies Created

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts

  • andymager
    Member

    Thanks Peter i solved it.

    var quotation_enquiry_parts__quotation_source =
    {
    datatype: “json”,
    datafields: [
    { name: ‘QUOTATION_PART_ID’ },
    { name: ‘QUOTATION’ },
    { name: ‘QUOTATION_ITEM_NO’ },
    { name: ‘GROUP_ON’ },
    { name: ‘PART_NO_SUPPLIER’ },
    { name: ‘PART_DESC_SUPPLIER’ },
    { name: ‘QUANTITY_SUPPLIER’ },
    //——————————————————————————–
    { name: ‘UNIT_SUPPLIER’ , value: ‘UNIT_SUPPLIER’, values: { source: units_adapter.records, value: ‘UNIT_ID’, name: ‘UNITNAME’ } },
    //——————————————————————————–
    { name: ‘SUPPLIER_PRICE’ },
    { name: ‘DELIVERY_TIME’ },
    { name: ‘DELIVERY_COMMENTS’ },
    { name: ‘ENQUIRY_PART_SP’ },
    //——————
    { name: ‘ENQUIRY_PART’ },
    { name: ‘ITEM_NO’ },
    { name: ‘PART_NO’ },
    { name: ‘PART_DESC’ },
    { name: ‘QUANTITY’ },
    { name: ‘PART_COMMENTS’ },
    { name: ‘GROUP1’ }
    ],
    cache: false,
    //async: false,
    url: ‘php/quotations/quotation_enquiry_parts__quotation.php’,
    type: ‘POST’
    }

    //and on the grid

    $(“#grid2”).jqxGrid(
    {
    source: quotation_enquiry_parts__quotation_adapter ,
    theme: theme2,
    editable: true,
    width: ‘1200’,
    height: ‘400’,
    rowsheight: 20,
    altrows: true, altstep: 1,
    selectionmode: ‘singlecell’, // singlecell singlerow
    editmode: ‘selectedcell’, // click selectedcell dblclick
    columns: [
    { text: ‘No’ ,datafield:’QUOTATION_ITEM_NO’ ,width: ’40’, columntype:’text’, cellsalign: ‘center’, align: ‘center’ },
    { text: ‘Part No.’ ,datafield:’PART_NO_SUPPLIER’ ,width: ‘150’, columntype:’text’},
    { text: ‘P’ ,datafield:’PART_NO’ ,width: ’40’, columntype:’text’},
    { text: ‘Description’ ,datafield:’PART_DESC_SUPPLIER’ ,width: ‘250’, columntype:’text’},
    { text: ‘D’ ,datafield:’PART_DESC’ ,width: ’40’, columntype:’text’},
    { text: ‘Qty’ ,datafield:’QUANTITY_SUPPLIER’ ,width: ’50’, columntype:’text’},
    { text: ‘Q’ ,datafield:’QUANTITY’ ,width: ’40’ ,columntype:’text’},
    //{ text: ‘Unit’ ,datafield:’UNIT_SUPPLIER’ ,width: ’80’ , columntype: ‘dropdownlist’, source: units_adapter, displayMember: ‘UNITNAME’, valueMember: ‘UNIT_ID’ ,
    { text: ‘UNIT_SUPPLIER’, datafield: ‘UNIT_SUPPLIER’, columntype: ‘dropdownlist’, displayMember: ‘UNITNAME’,source: units_adapter,
    createeditor: function (row, value, editor)
    {
    units_adapter = new $.jqx.dataAdapter( units_source,// { autoBind: true } ,
    { loadError: function (xhr, status, error) {alert (“Error loading php/general/units.php”)}});
    editor.jqxDropDownList({ source: units_adapter, displayMember: ‘UNITNAME’, valueMember: ‘UNIT_ID’ , autoBind: true });
    }

    }
    ],
    }
    );


    andymager
    Member

    #Include the connect.php file
    include(‘connect.php’);
    #Connect to the database
    //connection String
    $connect = mysql_connect($hostname, $username, $password)
    or die(‘Could not connect: ‘ . mysql_error());
    //Select The database
    $bool = mysql_select_db($database, $connect);
    if ($bool === False){
    print “can’t find $database”;
    }
    // get data and store in a json array
    $query = “SELECT * FROM list”;
    // SELECT COMMAND
    $result = mysql_query($query) or die(“SQL Error 1: ” . mysql_error());
    while ($row = mysql_fetch_array($result, MYSQL_ASSOC))
    {
    $list[] = array(
    ‘LAST_NAME’ => $row[”LAST_NAME’],
    ‘FIRST_NAME’ => $row[‘FIRST_NAME’],
    ‘ID_PERSON’ => $row[‘ID_PERSON’],
    ‘MOBILE_PHONE’ => $row[‘MOBILE_PHONE’],
    ‘PLATE’ => $row[‘PLATE’],
    );
    }
    echo json_encode($list);


    andymager
    Member

    Hi. I am new to jqwidjets.

    vagkom is it possible to write down All the code you used with $.getJSON .

    thank you.

Viewing 3 posts - 1 through 3 (of 3 total)