jQWidgets Forums
jQuery UI Widgets › Forums › Grid › rows -details
Tagged: master grid details
This topic contains 9 replies, has 3 voices, and was last updated by Peter Stoev 12 years, 8 months ago.
-
Authorrows -details Posts
-
hi i use this example from Peter STOEV, but any data from details.
this is my code:
$(document).ready(function () {
// prepare the data
var source =
{
datatype: “json”,
datafields: [
{ name: ‘COPHASE’ },
{ name: ‘DCI’ },
{ name: ‘DOSAGE’ },
{ name: ‘SPECIALITE’ },
{ name: ‘FORME’ },
{ name: ‘CLASSE’ },
{ name: ‘PRIX’ },
{ name: ‘LISTE’ },
{ name: ‘LABO’ },
{ name: ‘MEDIC’ }
],
id: ‘meddci_dci’,
url: ‘data1.php’,
root: ‘Rows’,
beforeprocessing: function (data) {
source.totalrecords = data[0].TotalRows;
}
};
var dataAdapter = new $.jqx.dataAdapter(source);$(“#jqxgrid”).jqxGrid(
{
width: 1200,
source: dataAdapter,
theme: ‘ui-le-frog’,
pageable: true,
autoheight: true,
virtualmode: true,
rendergridrows: function () {
return dataAdapter.records;
},
columns: [
{ text: ‘COPHASE’, datafield: ‘COPHASE’, width: 70 },
{ text: ‘DCI’, datafield: ‘DCI’, width: 330 },
{ text: ‘DOSAGE’, datafield: ‘DOSAGE’, width: 100 },
{ text: ‘SPECIALITE’, datafield: ‘SPECIALITE’, width: 180 },
{ text: ‘FORME’, datafield: ‘FORME’, width: 100 },
{ text: ‘CLASSE’, datafield: ‘CLASSE’, width: 140 },
{ text: ‘PRIX’, datafield: ‘PRIX’, width: 50 },
{ text: ‘LISTE’, datafield: ‘LISTE’, width: 100 },
{ text: ‘LABO’, datafield: ‘LABO’, width: 80 },
{ text: ‘MEDIC’, datafield: ‘MEDIC’, width: 50 }
]
});var detailsInitialized = false;
$(“#jqxgrid”).bind(‘rowselect’, function (event) {
var row = event.args.rowindex;
var id = $(“#jqxgrid”).jqxGrid(‘getrowdata’, row)[‘meddci_dci’];
var source =
{
url: ‘data1.php’,
async: false,
dataType: ‘json’,
data: {med_dci: id},
datatype: “json”,
datafields: [
{ name: ‘DCI’ },
{ name: ‘FORME’ },
{ name: ‘INDICATION’ },
{ name: ‘POSOLOGIE’ },
{ name: ‘CONTRE INDICATIONS’ },
{ name: ‘EFFET’ },
{ name: ‘CATEGORIE’ },
{ name: ‘TYPE’ }
]
};
var dataAdapter = new $.jqx.dataAdapter(source);
// initialize jqxGrid
$(“#ordersGrid”).jqxGrid(
{
width: 1200,
source: dataAdapter,
pageable: true,
autoheight: true,
columns: [
{ text: ‘DCI’, datafield: ‘DCI’, cellsformat: ‘d’, width: 40 },
{ text: ‘FORME’, datafield: ‘FORME’, width: 100 },
{ text: ‘INDICATION’, datafield: ‘INDICATION’, width: 250 },
{ text: ‘POSOLOGIE’, datafield: ‘POSOLOGIE’, width: 200 },
{ text: ‘CONTRE INDICATIONS’, datafield: ‘CONTRE INDICATIONS’, width: 250 },
{ text: ‘EFFET’, datafield: ‘EFFET’, width: 200 },
{ text: ‘CATEGORIE’, datafield: ‘CATEGORIE’, width: 100 },
{ text: ‘TYPE’, datafield: ‘TYPE’, width: 40 }
]
});
});
});</html>
i have 2 tables :
– peg_medicemment : (‘COPHASE’ ‘DCI’ ‘DOSAGE’ ‘SPECIALITE’ ‘FORME’ ‘CLASSE’ ‘PRIX’ ‘LISTE’ ‘LABO’MEDIC)
– peg_medicemment_dci : ( ‘DCI’ ‘FORME’ ‘INDICATION’ ‘POSOLOGIE’ ‘CONTRE INDIC’ ‘EFFET’ ‘CATEGORIE’ ‘TYPE’)what’s wrong???
thanks
Hi paco,
Here’s an example with Master-Details: masterdetails.htm
Hope this helps.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comI have data source from mysql, with 2 tables.
How can i implemente?Please, take a look at the samples in the phpdemos folder which is included in the download package. There’s an example with master-details tables and the data source is MySQL DB.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comI have try with this example, but i have any data on details. rows are empty
Unfortunately, I don’t know what could be the issue on your side. Check what happens when you click on a row and what data is returned by your server script. The provided examples are using the sample Northwind database, but in order to try them, you should install that database.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comHi,
I try your example with the demo : rowdetails.htm. Is working find until I try to past parameter in the url like :
jqwidgets-ver2.4.2/demos/jqxgrid/rowdetails.htm?bug=test
When I add parameter ?bug=test the tabs disappear and I just see the text for Nancy and Notes tabs.
May be because the parameter of the sample should be a theme and doing this you actually try to apply a theme with name equal to bug=test. However, we don’t have a theme such name.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comDo I always need to past the theme in parameters ?
I open my page with my own parameter without specifies any theme, I assume that if gettheme() don’t find the right css file, they will use the default theme.
No, you don’t have to pass the theme in parameters. You just need to include the theme’s CSS and to set the widget’s theme property to the theme’s name.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com -
AuthorPosts
You must be logged in to reply to this topic.