I am using ag-grid version 20 (ee).
I am trying to use colSpan :
colSpan: (params: ColSpanParams) => params.node.isRowPinned() ? 3 : 1
I obtain following famous ag-gri error on console:
core.js:4002 ERROR Error: ag-Grid: cannot get grid to draw rows when it is in the middle of drawing rows. Your code probably called a grid API method while the grid was in the render stage. To overcome this, put the API call into a timeout, eg instead of api.refreshView(), call setTimeout(function(){api.refreshView(),0}). To see what part of your code that caused the refresh check this stacktrace.
at push../node_modules/ag-grid-community/dist/lib/rendering/rowRenderer.js.RowRenderer.getLockOnRefresh (rowRenderer.js:269:1)
at push../node_modules/ag-grid-community/dist/lib/rendering/rowRenderer.js.RowRenderer.redrawAfterScroll (rowRenderer.js:469:1)....
by replacing with the problem disappear, but i need colspan to be different to 1,
understand the origin of the problem
Related
I am using google-sheet-api for my project and it totally works fine most of the time. But at times it behaves differently. Last time I encountered with a problem that some of cells filled by my data which I am not intend to. It randomly picked one of the values from my data and filled up other cells in my row. So my question is , Is this something with on my side or google-sheets-api issues ??
Used code:
const writeReq = await sheets.spreadsheets.values.append({
spreadsheetId:id, range:'range', valueInputOption:"USER_ENTERED",
resource:{
values:[
["data1", "data2", "data3", "data4", "data5", "data6", "data7", "data8"],
]
}
})
It's a bug
Issues with spreadsheets.values.append appending values at the wrong location in the sheet are already know and reported on Google's Issue Tracker - see API values.append sometimes adds row not where it supposed to and Sheets V4 does not provide any suitable append operation
What you can do is "star" the issues to increase visibility, so that hopefully the issue will be fixed soon
I want to start by saying that I am by no means an expert in JavaScript, so apologies in advance if I am missing something obvious.
Example:
I'm trying to create a custom tooltip for column A. Using the data from another cell as the parameter for the output of column A's tooltip.
{title: "title", tooltip: function(cell) {return anotherfunction(cell)}...
When passing 'cell' through as a parameter, it's possible to view the information in the rest of the row console.log(cell._cell) but from what I've discovered, there's no way of accessing the rest of the data.
This is a code pen of the issue that I'm having (i've commented out the console.log(cell._cell.value) in the example, as this will make the table fail to render. So, looking at the browsers console, it's possible to see the data that is returned from console.log(cell._cell).
I've tried to use Tabulators cell.getData(), cell.getRow(), cell.getColumn() etc (and a load of others) but each results in an error.
Codepen
https://codepen.io/lukeorriss/pen/yLzMapg
If someone could please point me in the right direction for accessing the data in another row from a tooltip function, this would be great. Thank you all, in advance.
Tabulator use 2 types of definitions for tooltip .
ColumnComponent (Header Cell)
Cell (Data Cell)
So You have to put a condition for your formatTooltip function
function formatTooltip(cell) {
// Need to open browser console log to view this.
if (cell._cell) {
let { name, email, address } = cell.getData();
return `You are ${name}, your email is ${email} and address is ${address}`;
} else if (cell.type === "ColumnComponent") {
return cell.getField();
}
}
See My Codepen
I'm receiving some data back from Google Books API calls and I'm mapping the data into a lighter array I can then work with. I'm using this line to map the data I'm interested into:
data.items.map(function(book) {
return { googleId : book.id, image : book.volumeInfo.imageLinks.thumbnail, authors : reduceAuthors(book.volumeInfo.authors), title : book.volumeInfo.title, subtitle : book.volumeInfo.subtitle, publishedDate : book.volumeInfo.publishedDate, publisher : book.volumeInfo.publisher}
});
Most of the times it works just fine, but some times one of the elements is missing, may it be imagelinks or authors therefore I get this error "Uncaught TypeError: Cannot read property of undefined".
What is the best way to avoid this error?
The only solution I have in mind is to first run a sanity check on the whole data and apply the map only after, but there maybe is a better solution? And wrapping everything in a try and catch throws me out of the mapping operation too early and doesn't complete with the rest of the data.
You can check it inside map() function, without handle previously the entire data. With a ternary conditional , something like this:
image : ((book.volumeInfo.imageLinks) ? book.volumeInfo.imageLinks.thumbnail : undefined)
So if book.volumeInfo.imageLinks is null/empty/undefined there aren't error and the value inserted will be undefined, otherwise catch the thumbnail value.
I'm modifying a "Rally" project management software "app".
I added the "Blocked" field to a custom table display.
But when I try to Sort on "Blocked", it doesn't seem to work.
It doesn't error, but it seems to break any ordering following "Blocked".
That is, if I put "Blocked asc/desc" as the first Order column, I have no ordering. If I put it following one or more other columns, it seems like it sorts on those preceding columns, but not Blocked or anything following.
Here is the relevant section of the api javascript I am modifying:
var queryConfigs = [];
queryConfigs[0] = { type : 'hierarchicalrequirement',
key : 'stories',
fetch: 'ObjectID,FormattedID,Name,ScheduleState,State,Blocked,' +
'Owner,UserName,DisplayName,Tasks,Defects,TestCases,LastVerdict,AttributionKanbanStates',
query: storyCriteria,
order: 'Blocked asc, AttributionKanbanStates asc'
};
. . .
rallyDataSource.findAll(queryConfigs, showResults);
Has anyone else had luck sorting by Blocked?
Per WS API documentation Blocked is not sortable. Click on HierarchicalRequirement object in the object model, and scroll to Blocked attribute. Sortable is false.
I am having a weird problem that I hope you can help me with.
I have Highcharts running on a dev website -- I use a simple form to allow the user to enter data.
On the same page, a Highchart shows once data is entered.
The data entry form has very simple jQuery-based snippets, eg. form validation, a counter for max number of characters, etc.
What happens is that when there is chart data in the database, the chart plots correctly, and the remaining JS snippets work as expected wen you try to enter new datapoints.
But if there is no data in the database (therefore no Highchart is shown), all my JS snippets stop working.
On Firebug console, I get this error when there is no data to form a chart:
jb is null
function n(m,h){kc=ya(a.title,m);tc=ya...play:""});Aa.body.appendChild(Qb)}Tc=
highcharts.js (line 47)
On Chrome, a different error shows as
Uncaught TypeError: Cannot set property 'innerHTML' of null
d.d.extend._Deferred.f.resolveWith jquery.min.js:16
d.d.extend.ready jquery.min.js:16
d.c.addEventListener.A
Again, these errors disappear as soon as I enter the first data point and a chart is formed.
Does anyone know what is happening and how I can get my JS to work when a Highchart is empty?
Any pointers are much appreciated. Thanks!
For me the problem was that I wasn't including jQuery before including HighCharts.
<script src="http://code.highcharts.com/highcharts.js"></script>
<script src="http://code.highcharts.com/highcharts-more.js"></script>
<script src="http://code.highcharts.com/modules/exporting.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
Threw the errors:
Uncaught TypeError: Cannot read property 'addEvent' of undefined(anonymous function) # highcharts.js:313(anonymous function) # highcharts.js:315(anonymous function) # highcharts.js:331
Uncaught TypeError: n.getOptions is not a function(anonymous function) # highcharts-more.js:8(anonymous function) # highcharts-more.js:55
Uncaught TypeError: Cannot read property 'fireEvent' of undefined(anonymous function) # exporting.js:9(anonymous function) # exporting.js:24
But if I included jQuery first it didn't.
I had this problem. I had to surround the highChart creation code with document.ready
$(document).ready({
chart = new Highcharts.Chart({ //my cool chart
});
});
OK, this error popped up again and that's because my comment above did not really solve it.
Here's the culprit: if you have a model that generates data for charts happen to return an empty array (say it's a new user and she hasn't added any data yet to the database), this empty array is passed to the controller -- which will then pass the empty array to the view with Highcharts.
When passing an empty array to my view containing Highcharts, Highcharts would run but would not find an element to inject the chart, because I also had a condition in the view that removed #container if there was no data.
Without where to put the chart, Highcharts returns an innerHTML error, that may or may not break your remaining javascript (my case).
The solution here had nothing to do with JS, but actually with putting a condition in my controller which would be in pseudo code:
if model that generates chart data returns empty array
don't generate view containing Highcharts
else
generate view containing Highcharts
Doing this not only I prevented the error for good but also reduced the overhead of running Highcharts when no data is present.