-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
width calculation fails when upgrading from 8.3 #667
Comments
Maybe you should have: $("#example1").handsontable({
data: data.clusters,
... |
sorry I have this a couple lines higher: clusters =data.clusters |
{
"data": 5620,
"type": {
"renderer": "myReadonlyRenderer"
}
} Are you sure that you have registered |
yes this is my actual renderer: function myReadonlyRenderer(instance, td, row, col, prop, value, cellProperties) {
Handsontable.TextCell.renderer.apply(this, arguments);
//use the built-in text cell renderer
var readOnlyClass="";
if (cellProperties.readOnly) {
readOnlyClass = 'dimmed ';
//apply "dimmed" class if cell has readOnly property
}
if (parseInt(value, 10) < 0) { //if row contains negative number
td.className = 'negative '+readOnlyClass; //add class "negative"
}else if(isNaN(value)){
if (cellProperties.remainerColumn){
td.className = 'negative '+readOnlyClass; //add class "negative"
}
} else if (parseInt(value, 10) > 0) {
if (cellProperties.remainerColumn){
td.className = 'positive '+readOnlyClass;
} else {
td.className = readOnlyClass;
}
}
else {
if (cellProperties.remainerColumn){
td.className = 'zero '+readOnlyClass;
} else {
td.className = readOnlyClass;
}
}
} relatively similar to one of the samples on the website. css is in as well: .dimmed {
font-style: italic;
color: #777;
white-space: nowrap;
}
.negative {
color: red;
}
.zero {
color: green;
}
.positive {
color: orange;
} For a second I thought it could be because of the css but then the js doesnt care about it, it only assigns a class.. quite puzzled by this error, tried to add some breakpoints, I truly cannot find it. |
Shouldn't it be: {
"data": 5620,
"type": {
"renderer": myReadonlyRenderer
}
} ? What errors do you see in the console? |
I think that you should add function reference in this code fragment I cite above and not string. |
@warpech I see this: Uncaught TypeError: Property 'renderer' of object # is not a function jquery.handsontable.full.js:2665 @codename- : good suggestion, I will try that |
Maybe adding this line above the constructor will work: Handsontable.cellTypes.myReadonlyRenderer = {
renderer: myReadonlyRenderer
} This will alias |
^up - but then you need also change: "type": {
"renderer": 'myReadonlyRenderer'
} for this: "type": 'myReadonlyRenderer' |
I will try this, as I cannot remove quotes arround myReadonlyRender (loaded through json call) |
and that was it, thanks guys! |
Thanks very much for the help, I can finally use the fixed columns now ;) |
Non of them should be corrected. You should use API as is in specification written :) |
I will add some error message that can help isolate the problem |
thanks, I was using this as a base: maybe mention on this page that loading the renderer through a ajax/json On Thu, May 16, 2013 at 3:03 PM, Marcin Warpechowski <
|
@Alderaic - this information could be helpful 👍 |
In version 0.9.0, I updated the http://handsontable.com/demo/conditional.html example with you advice. Also wiki Options page was updated about Thanks for this report! |
Hi, upgrading from 8.3 to 8.23, I get consistantly the same error when loading my table:
This is what I use to load my table,
My Data is this:
I was able to display some stuff by changing the width but then it only displays headers and the first row before giving me that error again.
I went through the changelog a couple times, but I cannot find what changed except in 8.3 but that's what I was already on.
The text was updated successfully, but these errors were encountered: