Hello,
I have "editMode: 'row'" set in my Updating feature. I noticed in my grid when I update a cell, every other cell in the row gets blanked out and the row object in pending transactions has all empty strings as well. I believe I am likely missing something simple, but I did try looking through the documentation.
If I change editMode to 'cell' then I can edit each cell one-by-one but then I don't get the row object that I need in pendingTransactions.
Please let me know if I am unclear.
Thanks
mhead1 & Martin,
Thank you both very much. This was the problem all along-- this has actually solved two separate issues I was having!
Regards,
Alex
@Alex
Hello Alex,
I still don't see a comment about it there unless I am missing something. I first saw this on the Row Edit dialog example in the html example in the code with a comment about the primary key needs to be labeled with dataType = "number" if it is actually a number. I think it should be in the IgniteUI API reference for igGrid in the options section under primary key. It should explain the use of dataType = "number" and what could happen if it is not used when the data is actually a number. I had a page where I was using batch updates and noticed this problem (didn't notice before because I usually update immediately with ajax). I usually didn't label the dataType for that column and I use guids for keys. Anyway I ended up modifying the generatePrimaryKeyValue to generate a unique key for the grids on my page (3 grids) until I could get it back to the server to create a real guid. It is below where MST.GetNewID is a page-wide array:
generatePrimaryKeyValue: function (evt, ui) { var n = Math.max.apply(Math, MST.GetNewID) + 1; MST.GetNewID.push(ui.value); var z = '0'; var n = n + ''; var width = 12; var last12 = n.length >= width ? n : new Array(width - n.length + 1).join(z) + n; ui.value = "00000000-0000-0000-0000-" + last12;
}
Thanks again for the clarification.
Could you please look at my question about setting width of grid to 100%. Then resizing the window will cause the grid to resize when going smaller but will add a horizontal scrollbar. If resizing larger it would stretch the top and bottom of grid but leave the columns at that size the page loaded at. I just didn't know if I am missing a setting or what. I ended up using the below as a workaround until someone could let me know for sure:
Under the question:
$(window).resize(function () {
$('table').css("width", "100%");
$("#SOD_gridServiceList_hscroller_container").css("height", "0");
});
The table selector will grab the inner table on the grid and resize it back to 100% instead of a fixed width and the height must be changed on the hscroller_container of the grid to 0 to keep if from appearing. You can't change it to display:none or it will just keep reappearing.
This method will resize the grid with the page and keep the fixed columns the correct width and the non-fixed width columns will stretch or compress correctly without the scrollbar.
Thanks,
Michael
I agree with mhead1, you should check if you set a dataType in the column configuration of your primary key column.
@mhead1: This information is added to the documentation. In the igGrid Updating topic see the Enabling Updating section(there is a note after the igGrid configuation in JavaScript code snippet).
Best regards,Martin PavlovInfragistics, Inc.
Check if you have set a primary key in your settings.
If you are allowing the grid to automatically set the primary key :
You must set the dataType of that column to "number" or it will give you problems like you mentioned.
I had the same problem and wasted hours on trying to click to update a row and then all my values would disappear. However if I stopped editing the row was really there.
I asked Infragistics to make sure they put that in the documentation.