jQWidgets Forums
jQuery UI Widgets › Forums › Grid › Checkbox issue in Row Edit
This topic contains 14 replies, has 4 voices, and was last updated by Dimitar 11 years, 5 months ago.
-
Author
-
Hi,
I’ve created a grid with 3 columns and one check box column.
While editing a row, I couldn’t update all the column values properly and making two requests separately to update the data, one for check box and another for remaining columns.
And more over check box column is not coming as edit mode like other columns.Please suggest me.
Regards,
KiranHello Kiran,
Please provide us with a sample code which demonstrates the reported issue.
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/Hi this is the code for issue what we posted……
<script src=”~/Scripts/jquery-2.0.3.js”></script>
<link href=”~/jqwidgets/styles/jqx.base.css” rel=”stylesheet” />
<link href=”~/jqwidgets/styles/jqx.arctic.css” rel=”stylesheet” />
<script src=”~/jqwidgets/jqxcore.js”></script>
<script src=”~/jqwidgets/jqxdata.js”></script>
<script src=”~/jqwidgets/jqx-all.js”></script>
<script src=”~/jqwidgets/jqxgrid.js”></script>
<script src=”~/jqwidgets/jqxgrid.pager.js”></script>
<script src=”~/jqwidgets/jqxgrid.sort.js”></script>
<script src=”~/jqwidgets/jqxgrid.filter.js”></script>
<script src=”~/jqwidgets/jqxgrid.selection.js”></script>
<script src=”~/jqwidgets/jqxgrid.edit.js”></script>
<script src=”~/jqwidgets/jqxgrid.columnsresize.js”></script>
<script src=”~/jqwidgets/jqxbuttons.js”></script>
<script src=”~/jqwidgets/jqxlistbox.js”></script>
<script src=”~/jqwidgets/jqxdropdownlist.js”></script>
<script src=”~/jqwidgets/jqxmenu.js”></script>
<script src=”~/jqwidgets/jqxcheckbox.js”></script><script type=”text/javascript”>
$(document).ready(function () {
var source =
{
datatype: ‘json’,
datafields: [
{ name: ‘UserId’ },
{ name: ‘UserName’ },
{ name: ‘FirstName’ },
{ name: ‘LastName’ },
{ name: ‘Status’,type: ‘bool’ }
],
id: ‘UserId’,
url: ‘Home/binddata’,
updaterow: function (rowid, rowdata, commit)
{
var rowindex = $(“#jqxgrid”).jqxGrid(‘getrowboundindexbyid’, rowid);
function getrowstoupdate()
{
var rowdata1 = {};
rowdata1.Id = rowdata.Id;
rowdata1.CountryId = countryid;
rowdata1.StateId = StateId;
rowdata1.CityName = rowdata.CityName;
return rowdata1;
}
var data1 = JSON.stringify(getrowstoupdate());
$.ajax({
url: ‘/Home/UpdateData’,
data: data1,
cache: false,
type: ‘POST’,
contentType: ‘application/json; charset=utf-8’,
success: function (data) {
// alert(“Data updated Successfully………”);
}
});
commit(true);
}
};
var dataAdapter = new $.jqx.dataAdapter(source);
$(“#jqxgrid”).jqxGrid({
width: 950,
source: dataAdapter,
theme: ‘arctic’,
pageable: true,
autoheight: true,
sortable: true,
editable: true,
filterable: true,
editmode: ‘selectedrow’,
enabletooltips: true,
columns: [
{ text: ‘UserId’, datafield: ‘UserId’, width: 250, hidden: true },
{ text: ‘UserName’, datafield: ‘UserName’, width: 250 },
{ text: ‘FirstName’, datafield: ‘FirstName’, width: 250 },
{ text: ‘LastName’, datafield: ‘LastName’, width: 250 },
{ text: ‘Status’, datafield: ‘Status’,columntype: ‘checkbox’, width: 250,type:’bool’ },
],
});
});Hi Kiran,
Everything seems in order with the code you provided us. It is possible that the issue originates elsewhere.
The updaterow callback function is called when a row is updated. If multiple rows are added, the rowid and rowdata parameters are arrays of row ids and rows. When you call the updaterow method, the grid will also call the source object’s updaterow callback function (if defined). You can use the callback function for server synchronization.
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/<img src=”https://www.google.co.in/search?hl=en&site=imghp&tbm=isch&source=hp&biw=1600&bih=799&q=bhanu.vaddavalli&oq=bhanu.vaddavalli&gs_l=img.12…1341.6365.0.7597.16.7.0.9.0.0.842.2542.1j2j0j1j1j1j1.7.0….0…1ac.1.32.img..14.2.187.EU6tYLOFqms#facrc=_&imgdii=_&imgrc=-inbXr96kUwOQM%3A%3B3EJ0GWZonilRGM%3Bhttps%253A%252F%252Flh5.googleusercontent.com%252F-uvI_nV70vO0%252FUMCovc5jH9I%252FAAAAAAAAAA4%252FDqQjXPNkUMs%252Fbhanu%2525252520photo.jpg%3Bhttps%253A%252F%252Fpicasaweb.google.com%252F106683757909927880859%252FProfilePhotos02%3B331%3B332
” alt=”problum with grid row editing” />hi this is the image for above code. here grid making two requests separately to update the data, one for check box and another for remaining columns.
Hi bhanu.vaddavalli(Kiran Ch),
I would like to ask you to post only from one account and to avoid duplicate posts in the future.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com/how can i show my local out put image here……?image is not uploading through my
systemHi Kiran Ch,
You cannot show an image from your local file system on a web forum. You should upload the image somewhere on the web and link to it.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com/Why I am not able to see my links here?
Hi Kiran Ch,
Please do not embed the images, but post a link to each one here.
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/Hi Kiran Ch,
If a grid is editable, its checkbox cells are always in edit mode.
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/Hi,
But it is sending two requests to save the data. and only one is successful.
Do I change my logic?Thank you…
KiranHi Kiran,
Please share a complete example and remember to format your code by selecting it and clicking the code button in the toolbar.
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/ -
AuthorPosts
You must be logged in to reply to this topic.