jQWidgets Forums
Forum Replies Created
-
Author
-
Tankk you Ivailo,
If I need to put some text, title or other component on the same tab, would it be the same process with html?
Hello guys!
Well, I found a technically simple solution to fix the date on your display in the DataTable, the database table I added the CURRENT_TIMESTAMP, and presto, end of story!
I hope I never need to convert the timezone of the dates directly on the component! LOL
Thank you
Good Morning,
My question is too silly for you not answer me? Please help me!
Ha,
when I use this feature,
function getExportServer() {
return ‘http://www.jqwidgets.com/export_server/export.php’;
}everything works perfectly, so I think the error may be the way directories are organized and how I call the files!
least the print logically!
October 30, 2015 at 12:03 pm in reply to: groupsRenderer show sum in Groups and subgroups groupsRenderer show sum in Groups and subgroups #77568I understand now, thank you, you saved me!
October 29, 2015 at 3:03 pm in reply to: groupsRenderer show sum in Groups and subgroups groupsRenderer show sum in Groups and subgroups #77522Good afternoon!
After much thought I could prepare an example in jsFiddle, and is almost the same as mine. The difficulty lies in showing the sum of the Total column for each level of grouping, for example, if I group them with Cliente, or Unidade or Fornecedor, works perfectly, but if I group with 2 levels, Cliente and Unidade, the sum only It appears for Unidade and not for Cliente.
Here is the link!
https://jsfiddle.net/condeso/k1sasd5b/3/What I intend to do and group by “Cliente”, “Unidade” and “Fornecedor”, ie 3 grouping levels, how can I implement this in the function?
October 21, 2015 at 11:48 am in reply to: groupsRenderer show sum in Groups and subgroups groupsRenderer show sum in Groups and subgroups #77184Well, so in this case I will show my code, but I believe this will not make a difference, because what I ALMECO and group with two, three or four layers layers and mater the total sum in each layer, but come on, see if that helps.
var source = {
dataType: “json”,
datafields:
[
{name: ‘actions’, type: ‘string’},
{name: ‘fornecedor’, type: ‘string’},
{name: ‘posto’, type: ‘string’},
{name: ‘pcnpj’, type: ‘string’},
{name: ‘cliente’, type: ‘string’},
{name: ‘unidade’, type: ‘string’},
{name: ‘ucnpj’, type: ‘string’},
{name: ‘numero’, type: ‘string’},
{name: ’emissao’, type: ‘date’},
{name: ‘total’, type: ‘string’},
{name: ‘chave’, type: ‘string’},
{name: ‘path’, type: ‘string’},
{name: ‘import’, type: ‘date’}
],
localdata: result
};var dataAdapter = new $.jqx.dataAdapter(source);
var toThemeProperty = function (className) {
return className + ” ” + className + “-” + theme;
};var groupsrenderer = function (text, group, expanded, data) {
var number = dataAdapter.formatNumber(group, data.groupcolumn.cellsformat);
var text = data.groupcolumn.text + ‘: ‘ + number;
var aggregate = this.getcolumnaggregateddata(‘total’, [‘sum’], true, data.subItems);
return ‘<div class=”‘ + toThemeProperty(‘jqx-grid-groups-row’) + ‘” style=”position: absolute;”><span>’ + text + ‘, </span>’ + ‘<span class=”‘ + toThemeProperty(‘jqx-grid-groups-row-details’) + ‘”>’ + “Total” + ‘ (‘ + aggregate.sum + ‘)’ + ‘</span></div>’;
};$(“#tfechamento”).jqxGrid({
width: ‘100%’,
sortable: true,
filterable: true,
autoshowfiltericon: true,
groupable: true,
autorowheight: true,
autoheight: true,
altrows: true,
localization: getLocalization(),
columnsresize: true,
showstatusbar: true,
statusbarheight: 90,
showaggregates: true,
groupsrenderer: groupsrenderer,
source: dataAdapter,
columns: [
{text: ‘Ações’, dataField: ‘actions’, width: ’80px’, cellsAlign: ‘right’},
{text: ‘Fornecedor’, dataField: ‘fornecedor’, width: ‘100px’},
{text: ‘Posto’, dataField: ‘posto’},
{text: ‘Cliente’, dataField: ‘cliente’},
{text: ‘Unidade’, dataField: ‘unidade’, width: ‘130px’},
{text: ‘Número’, dataField: ‘numero’, cellsAlign: ‘right’, align: ‘left’, width: ’70px’, aggregates: [‘count’],
aggregatesrenderer: function (aggregates, column, element) {
var renderstring = “<div class=’jqx-widget-content’ style=’float: left; background-color: #e5e5e5; width: 100%; height: 100%; ‘>”;
$.each(aggregates, function (key, value) {
var name = ‘Qt’;
renderstring += ‘<div style=”position: relative; margin: 6px; text-align: left; overflow: hidden;”>’ + name + ‘: <b>’ + value + ‘</b></div>’;
});
renderstring += “</div>”;
return renderstring;
}},
{text: ‘Emissao’, dataField: ’emissao’, cellsAlign: ‘right’, align: ‘left’, cellsFormat: ‘d’, width: ‘100px’},
{text: ‘Total’, dataField: ‘total’, cellsAlign: ‘right’, align: ‘left’, cellsFormat: ‘d2’, aggregates: [‘sum’, ‘max’, ‘avg’, ‘min’],
aggregatesrenderer: function (aggregates, column, element) {
var renderstring = “<div class=’jqx-widget-content’ style=’float: left; background-color: #e5e5e5; width: 100%; height: 100%; ‘>”;
$.each(aggregates, function (key, value) {
switch (key) {
case ‘sum’:
name = ‘Soma’;
color = ‘#000000’;
break;
case ‘avg’:
name = ‘Média’;
color = ‘#666666’;
break;
case ‘min’:
name = ‘Menor’;
color = ‘#777777’;
break;
case ‘max’:
name = ‘Maior’;
color = ‘#555555’;
break;
}
renderstring += ‘<div style=”color: ‘ + color + ‘; position: relative; margin: 6px; text-align: right; overflow: hidden;”>’ + name + ‘: <b>’ + value + ‘</b></div>’;
});
renderstring += “</div>”;
return renderstring;
}}
]
});Okay, that’s it, now imagine that I want to group the following columns: 1º customer 2º unit 3º supplier
but I want to bring up the total for all the customer’s total, total units of this client and the total supplier will be able to appear on each client drives, you know?October 20, 2015 at 11:58 am in reply to: groupsRenderer show sum in Groups and subgroups groupsRenderer show sum in Groups and subgroups #77142Good day Dimitar!
So it’s almost that, but as I said yesterday, I need it to return me the total for each group and subgroup, and this example you gave me only returns the total for the subgroup, for instance, if I group by customer it I retonar the total per user (OK), but if I group by customer and customer units, it me the total for customer units and customer show the text undefined, you know?
Another example of grouping, Customer, Customer Units and Supplier, was for him to return as each supplier produced for each customer unit (OK!) but also for the customer (the sum of all units) and it returns undefined!
I sought some algorithm to identify subgroups or groups and make the sum by grouping layers, but I’m not so familiar, can you help me or show me an example?| Costumer x |—–| Customer Unit x|
___________________________________________________________________________________________________________________________
| Customer | Customer Unit | Supplier | Supplier Unit | Day | Total |
—————————————————————————————————————————-
| > | Custumer A Total $50000 |
—————————————————————————————————————————-
| | > Unit A1 Total $ 25000 |
—————————————————————————————————————————-
| | > Unit A2 Total $ 10000 |
—————————————————————————————————————————-
| | > Unit A3 Total $ 15000 |
—————————————————————————————————————————-
| > | Custumer B Total $234000 |
—————————————————————————————————————————-
| | > Unit B1 Total $ 85000 |and so on!!!
Currently it shows:
___________________________________________________________________________________________________________________________
| > | Custumer B Total (undefined) <- the problem its here! |
—————————————————————————————————————————-
| | > Unit B1 Total $ 85000 |
—————————————————————————————————————————-Thank you for your patience and didactic me!
October 13, 2015 at 1:37 pm in reply to: groupable And FilterMode advanced DataTable groupable And FilterMode advanced DataTable #76793Thank Ivailo
Thank Ivailo!!!
It was exactly what I was trying to do, thanks for your insight!
October 9, 2015 at 3:14 pm in reply to: Refresh Aggregates And Table after inserting a row Refresh Aggregates And Table after inserting a row #76634I really did not return!
Thank you!
October 6, 2015 at 8:50 pm in reply to: Refresh Aggregates And Table after inserting a row Refresh Aggregates And Table after inserting a row #76486Any?
October 2, 2015 at 2:41 pm in reply to: Refresh Aggregates And Table after inserting a row Refresh Aggregates And Table after inserting a row #76386See my example:
This function receives parameters of an XML importer that le specific fields of the file and inserts in the DataTable, even though declaring the aggregates for the total column, it does not show the total! (even using update or refresh)
addnfreg function (name, chNFe, NNF, dhEmi, VNF, pCNPJ, uCNPJ, pxNome, uxNome) {
$ (“# t_nf”). jqxDataTable (‘addRow’, null, {
Files: name,
Key: chNFe,
number: NNF,
issuance: dhEmi,
post: pCNPJ,
unit: uCNPJ,
total: VNF,
nposto: pxNome,
nunidade: uxNome
}, ‘first’);
//$(“#t_nf”).jqxDataTable(‘update’);$(“#t_nf”).jqxDataTable(‘refresh’);
}October 2, 2015 at 2:34 pm in reply to: Refresh Aggregates And Table after inserting a row Refresh Aggregates And Table after inserting a row #76384I will try to explain here even very simple!
Imagine a table with the name, phone number, city and total price, right? It will be powered by the user, and when this finish entering data, the user clicks save, sending this data to the database.
The only thing I can’t do is update the aggregates every time I add a new line.
My clients need to read several xml files, so I created an importer, the importer read specific fields, such as those exemplified above, only that it does not update the total amount. Understood?Thanks.
FranciscoOK, I get it, but imegine the following columns, for example, Customer, City, and Total, right?
I would like to group by client, which is easy, use this:
groups: [‘customer’],
groupsRenderer: function (value, RowData, level) {
return “Client: <b>” + value + “</ b>”;
},
Now comes the problem, as I would put the total for each client side in his name? Understood?I’m not grouping by all, just including this information in function groupsRender!
-
AuthorPosts