I've just started using jqGrid and am having a problem trying to get the value of an edited cell when it loses focus. I have a two-column grid with only the first column editable. Eventually my aim is that when the user clicks out of a cell in this column, it will make an Ajax call to the server to populate the second column with a value. Right now, I'm testing by just having the value of the cell displayed in a div on the page. I find the event model very unclear and have tried all the events related to cell editing (beforeEditCell, afterEditCell, beforeSubmitCell, onSubmitCell, etc.) Only the beforeSubmitCell and onSubmitCell events actually return the value. The problem in my test is that when I first edit a cell, the correct value is shown, but when I edit other cells it keeps showing the value and row ID from the first edited cell. Here is my test page: http://www.galcott.com/jqgrid.html where you can see this happening and look at the code.
You have a lot of errors in your code and setup, which causes unexpected behavior.
1.You do not have included one of the important file - the language file. If you have include it you will see where is the problem.
2.You do not have include css framework file, which will cause sometime unexpected behavior.
3.You save a error in the grid parameter cellsubmit - in your code it is cellSubmit, while the working option is cellsubmit - JavaScript is case sensitive
4.At last the event onSubmitCell as I say in my comment should return true or false i.e
onSubmitCell: function(rowid, cellname, value, iRow, iCol) {
$('#celldata').html(iRow + ' ' + value);
if(some condition) {
return false;
}
return true;
}
In your code do:
$("#tbl1").jqGrid({
width: 400,
height: 400,
cellsubmit: 'clientArray',
editurl: 'clientArray',
...
and it will work
I am using Visual Studio in VB, I have 3 check boxes, one is set by default to be True, but when I select on of the other checkbox and change it to True, I want to set all the other Checkboxes to False I have tried some fairly simple code but it doesn't work - can someone help me? I am newish to code...!
I have tried
If CheckBox1.Checked = True Then
ChecBox2.checked= False
CheckBox3.checked = False
End If
According to http://www.webspellchecker.net/samples/grayt-ckeditor-plugin.html
the statement CKEDITOR.config.grayt_autoStartup = true; should activate "GrammarAsYouType (GRAYT) for CKEditor 4+" grammer service on the editor
Their demo code did not even show the spelling button on my local test.
The code from http://sdk.ckeditor.com/samples/spellchecker.html did show the spelling options but not grammer.
Tried to add to the config:"grayt_autoStartup = true," like the "scayt_autoStartup: true," works, but then the entire UI was gone and no spell or grammar check.
Any one has a spelling AND grammar working in a local deployment?
Thanks in advance
You are right - GRAYT for CKEditor can be started like this:
grayt_autoStartup: true
For adding spelling button to CKEditor UI you need the following:
CKEDITOR.config.toolbar = [{
name: 'editing',
items: ['Scayt']
}];
There is no separate button for GRAYT. So you will have button only for SCAYT.
jsfiddle: https://jsfiddle.net/jalners/j4ytgb2v/
I have a jqGrid that has the following properties;
grid.jqGrid({
datatype: "local",
data: GRID.GridData,
colModel: GRID.availableGridColumns['columnModel'],
loadonce: true,
It loads the data just fine.
I then make an inline edit to one to the cells.
I then apply a filter, or a sort, and the edit I made to the cell is now gone and the value is back to its original value.
I also have this;
var rowData = $('#Grid').jqGrid('getRowData', "11332601");
rodData.State = "Open";
$('#Grid').setRowData("11332601", rowData)
The value in the cell is changed but when I apply a filter or a sort, the cell value is changed back to its original value.
This can also be demonstrated here http://www.trirand.com/blog/jqgrid/jqgrid.html and then opening "New in version 3.3" and selecting the "Cell Editing" link.
Sort the grid by "Amount", change the value of "50.00" to be say "51.00". Sort by amount again and then again and you will see that "51.00" has changed back to "50.00".
Is there a workaround for this behavior?
I have more than 1000 rows to populate data through jqGrid. When I populate data through jqGrid, jqGrid takes more than 20 seconds to populate data. This time is taken only by jqGird (query execution time and other time is excluded). I have a requirement to populate 1000 rows by using jqGrid and I don't want to use Pagination. Please help me how to increase the performance of jgGrid.
The versions we are using are:
jgGrid: 3.6.4
jQuery:1.4.2
jQuery UI:1.7.2
Browser: IE 7
Following is the code:
jQuery("#displayItemPerformanceGrid").jqGrid({
//datatype: displayItemPerformanceGridData, //json
url:'/DISMGMT/StandardProxy/displayItemPerformanceService?userRole='+userRole+
'&userName='+userName+'&duration='+displayDuration+'&userId='+userId,
datatype: 'json',
colNames: ["CM","Display Location","Display Name","Item","Item Description",
"Store","DC","Date","Type","Promo Retail","Reg. Retail 50" "Units",
"Sales $", "Profit $"],
// $("#load_navGrid").html("Loading...").show();
colModel: [
{name:"cmName",index:"cmName",classes:"metric",width:130,resizable:true,
align:"left"},
{name:"displayLocation",index:"displayLocation",width:80,align: "left"},
{name:"displayName",index:"displayName",width:225,align:"left"},
{name:"item",index:"item",sorttype:"int",width:60,align:"left"},
{name:"itemDescription",index:"itemDescription",width:230,align:"left"},
{name:"store",index:"store",sorttype:"int",width: 70,align: "right"//,
//unformat : spaceFormatter
},
{name: "dc", index: "dc", sorttype: "int",width: 60,align: "right"//,
//unformat : spaceFormatter
},
{name:"date",index:"date",sorttype:"date",datefmt:"mm-dd-yy",width:80,
align: "left"},
{name: "type",index: "type",width: 45,align: "left"},
{name: "price",index: "price",width: 70,align: "left"},
{name: "regRetail",index: "regRetail",width: 70,align: "left"},
{name:"units",index:"units",sorttype:"int",width:45,align:"right",
unformat : spaceFormatter},
{name:"sales",index:"sales",sorttype:"int",width:45,align:"right",
unformat : spaceFormatter},
{name:"profit1",index:"profit1",sorttype:"int",width:40,align:"right",
unformat : spaceFormatter}
],
width: 982,
height: 137,
toolbar: [true, "top"],
viewrecords: true,
rowNum: 1500,
// gridview:true,
loadonce:true
});
Please suggest me how to improve performance of jqGrid
Use virtual scrolling (look at the demo, New in version 3.7 -> Virtual scrolling).
You question look like another question from trirand forum which I recently answered. To be sure I can repeate the information here.
In general for jqGrid is not a problem to display 1000 rows. The demo example which has 15 columns and 1000 rows will be displayed on my computer quickly enough. I have no IE7, but in IE8, IE9 beta, Chrome, Firefox, Opera and Safari (all in the last versions) the time to display the table is very quickly. In the example I use the modified jQuery UI, where .ui-widget :active { outline: none; } is removed. See here and here for more detailes.
So to be able to help you one need have possible full definition of your jqGrid inclusive the HTML code and test JSON data. You can capture the data with respect of Fiddler or Firebug. Probably you has some datatypes, don't use gridview:true option and use afterInsertRow method which make jqGrid working slower espetially for lagre pages. It can be also that you do many work inside of gridComplete or loadComplete event handler. So without having the code I can only guess. It can be also important which column you use for the sorting of the data and how you inserts the data in the grid (with data parameter, loadonce:true or using addRowData).
Another point of view is the usage of local paging. If you prefer to return all 1000 rows at once from the server it disturbs you not to use local paging of the 1000 rows of data. On the next example I demonstrate this. The problem is easy: all 1000 rows can not be displayed for the user at once. The user have to scroll the rows either in web browser or with respect fo jqGrid local paging. The advantage of the local paging is: only the data for one page will be placed in the table. All other data will be only hold in the sorted form internally. It can improve the performance and don't change almost anything from the users point of view.
More then that, having intelligent local filtering of data with respect of toolbar filtering or single field/advanced searching can help the user very much to analyse a lot of information from the 1000 rows which will be displayed him. Local filtering and local paging can be used very native together.