jQWidgets Forums
Forum Replies Created
-
Author
-
May 22, 2013 at 9:34 am in reply to: createeditor for columntype: 'dropdownlist' not showing the displaymember createeditor for columntype: 'dropdownlist' not showing the displaymember #21627
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 });
}}
],
}
);April 10, 2013 at 8:28 am in reply to: Rendering with PHP and JSON , how to Rendering with PHP and JSON , how to #18967#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);April 4, 2013 at 1:51 pm in reply to: Customer Rendering with PHP and JSON issue Customer Rendering with PHP and JSON issue #18602Hi. I am new to jqwidjets.
vagkom is it possible to write down All the code you used with $.getJSON .
thank you.
-
AuthorPosts