So I just got the latest update and I can no longer make updates. The I try to update my code I get this attached look. I do my updates a bit different so I'd rather just like to know what this is and how to turn it off.
thx Michael, thanks for the info.
Hi seang,
For the first issue, the hideColumnChooser method will hide the actual column chooser dialog. If you are referring to the icons in the header, you will need to set the allowHiding options in each columnSettings. For more information on the ColumnHiding feature, please see our documentation here:
http://help.infragistics.com/doc/jQuery/2014.1/CLR4.0/?page=igGrid_Hiding_Column_Chooser.html
Your other issues will take a little more time to look into. I will have another update for you by Monday with more information.
Adding the primary key columns and hiding it: Error bug log.
1) Is there any way to hie the column chooser ? I tried $(".selector").igGridHiding("hideColumnChooser"); but tha didnt work. So far the only way to do it is by applying allowHiding: false to each column.
$(
".selector"
).igGridHiding(
"hideColumnChooser"
);
2) I get this error "Error: Syntax error, unrecognized expression: #myDiv0_table_featureChooser_dd_ROW# jquery-1.8.2.js:4679" I was hopping you could give me an idea what may have caused it, I can't seem to narrow this one down. The error is thrown during the igGrid( {...}) section I believe.
If I comment this out it works.
{ name: "Hiding", columnSettings: [ { columnKey: PRIKEY, allowHiding: false, hidden: true }, ] },
this is the table data
myDiv0_table is part of my header.
471830.1 is my primary key
[{"AM":"12.13","ROW#":"4.99999","471830.1":0},{"AM":"6.78","ROW#":"4","471830.1":1},{"AM":"3.78","ROW#":"3","471830.1":2},{"AM":"2.11","ROW#":"2","471830.1":3},{"AM":"1.18","ROW#":"1","471830.1":4},{"AM":"0.66","ROW#":"0","471830.1":5}]
3) getting that nasty rec type error again... When I do a set cell idUpdating.setCellValue( cells[c].rowIndex, cells[c].columnKey, "3" ) I get TypeError: rec is null. I tried to alert (INSTANCE.gridIDMap.option("primaryKey" )); just before that line and the PK is good. The last time I got this error support concluded it was a fault primary key but now I'm using a primary key.old issue: http://ko.infragistics.com/community/forums/p/84982/430958.aspxcould anything else cause this error. If you need to see more code ill put it in a new post on this thread so I dont make a mess of this post.
IE says this
{origRec=this.findRecordByKey(t.rowId,origDs)}}if(t.type==="cell"){rec[t.col]=t.value;if(origRec)
{exception} Unable to set property 'Coolant Temp at Start' of undefined or null reference
'Coolant Temp at Start' is the column I'm trying to modify in.
DEBUGrec=this.findRecordByKey(t.rowId); = null but the data going in to findRecordByKey is good. Not sure why it returns null?
SO if I trace in to the function I get to the issue here
data[i][search]===key // fails because search is undefined.
search uses findRecordByKey
//this function fails because len is undefined. len failed because data is undefined and I have no idea why data is undefined.
findRecordByKey:function(key,ds)
{
var i,data=ds||this._data ,len=data?data.length:0 ,search=len>0&&$.isArray(data[0])?this._lookupPkIndex():this.settings.primaryKey;
for(i=0;i<len;i++){if(data[i][search]===key){return data[i]}}return null}
That is just how it was explained to me. The issue we have is that updating our grids by a primary key is no good because our columns dont always have unique numbers.
Correct The hidden column didn't work because of the counts. Sometimes functions count total columns as 3 and some as 2 ( 0 as first ). I tried every work around suggested and I always hit a wall of some kind.
So I gather you're suggesting I once again try the hidden column? The issue that we run in to is that its not always immediately obvious what problems are in the way. So I guess its best to leave this topic open and not close it right off.
I am not sure where you are getting the idea that the grid requires a constant DB connection when using a primary key. The primary key is required to edit the grid, however, the primary key is not required on any DB you are using the grid with, if that's what you are concerned about. A dummy key can be injected into the client side datasource and then you can push whatever required data to the server that you need, when you need it. This remains true with or without using a primary key. The primaryKey for the igGrid is used as an identifier so the client side operations know which row to process. Using one in the igGrid does not require any need of a connection to a DB.
As I mentioned in my earlier update, the inconsistency between the lengths of the columns collection which includes the hidden columns is the nature of javascript's arrays. The column exists whether it is hidden or not and the grid needs to know this. My suggested code will provide you with an array of only visible columns for where you need to reference them.
Since this would resolve the inconsistencies as you mention here, is there some other reason you would not be able to switch back to using the hidden column primary key? I have attached a sample that uses a hidden column for a primary key so the igGridUpdating feature works as expected and I also implement my visible column collection into a function for easy use. Without any more detail regarding what issues you are running into when including a primary key, I cannot offer much more advise as this is how the grid is designed to be used and including a primary key is the recommended solution.
If you still have any questions or concerns with this, please let me know.