jQWidgets Forums
jQuery UI Widgets › Forums › Grid › jqxgrid with property autorowheight and cellsrenderer
This topic contains 8 replies, has 2 voices, and was last updated by dmesabar 5 years ago.
-
Author
-
Hi,
I have a jqxgrid with the property autorowheight to show all content of text.
The problem is when once of cell have a function cellsrenderer, this cell lost or not calculate the margin-top
On image, the column Value have the function cellsrenderer and the first line dont calculate the margin-top.var cellsrenderer_value = function(row, column, value, defaulthtml, columnproperties, rowdata) { return $(defaulthtml).html(toFixedFormat(value,2))[0].outerHTML; };
The column quantity dont have the function cellsrenderer and the margin-top is calculate
How can solve?
Thanks.Hello dmesabar,
It is expected behavior.
Thecellsrenderer
callback is used to fully override the content of the cells.
You could get the settings from thedefaulthtml
argument (4th argument).
For this purpose, you could calculate it and return the right one.
Please, take a look at this example.Best Regards,
Hristo HristovjQWidgets team
https://www.jqwidgets.comHi Hristo,
You can see the example
I add on quantity cell the functioncellsrenderer
On grid result, you can see how the values not change the margin-top to stay center.Thanks.
Hello dmesabar,
Thank you for this feedback.
I will create a work item for this.
But if you provide me more details about what is your final goal then I will understand your case well.
After that, I could try to provide you a solution.Best Regards,
Hristo HristovjQWidgets team
https://www.jqwidgets.comHi Hristo,
My grid have a few cell with calculations.
I will have the columns, among others, Quantity, Price, Total…
Total = Quantity * Price
Some cells, I need to calculate the value and only I can set the value withcellsrenderer
Thanks.Hello dmesabar,
There are different approaches.
One is that you try.
Another option that you could try to pre-calculate the data is before it will be loaded into the jqxGrid.
For this purpose, thebeforeLoadComplete
callback it will be better to use for this case.
Please, take a look at this demo.Best Regards,
Hristo HristovjQWidgets team
https://www.jqwidgets.comHi Hristo,
I think that usebeforeLoadComplete
isn’t solution for this purpose.
My jqxGrid have the cells quantity and price editables. When one of cell is edit, automaticly will be calculate the total.
For this reason, I think that the best solution is usecellsrenderer
.
Thanks.Hello dmesabar,
You could use the
setcellvalue
method in case of using thebeforeLoadComplete
callback.
Depends on the changed value in one of the mentioned columns then change the value in thetotal
column.
I understand you.
Thank you for your patience.
I will create a work item for this case.
Please, let me know if you have any other questions.Best Regards,
Hristo HristovjQWidgets team
https://www.jqwidgets.comHi Hristo,
I know that I can use thesetcellvalue
on the cells that I need.
I simplified the exemple to see that the margin-top is not calculate when the cell have the functioncellsrenderer
In my grid I will have morecellsrenderer
, for example, to put buttons and/or icons and depends of more options to show this buttons.
Thanks for create a work.
I will wait for news. -
AuthorPosts
You must be logged in to reply to this topic.