Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
142722 | Feb 16,2019 02:51 PM UTC | Feb 23,2019 05:01 AM UTC | ASP.NET Web Forms | 3 |
![]() |
Tags: Spreadsheet |
We have resolved theRichTextEditorcomponent reportedissue “Unwanted question mark coming while using the tools present in the rich text editor” and included in17.2.51patch release.
<input type="button" value="Save Changes to Server" id="saveChangesToServer" />
<ej:Spreadsheet ID="Spreadsheet1" runat="server">
<ClientSideEvents LoadComplete="loadComplete" OpenFailure="openfailure" />
<ScrollSettings Width="100%" Height="470" IsResponsive="true" />
<Sheets>
<ej:Sheet>
<RangeSettings>
<ej:RangeSetting ShowHeader="false" />
</RangeSettings>
</ej:Sheet>
</Sheets>
</ej:Spreadsheet>
<script type="text/javascript">
$("#saveChangesToServer").on("click", function () {
//To get the bulk edited data in server side.
var ssObj = $("#MainContent_Spreadsheet1").data("ejSpreadsheet"), key, rowIdx, sheetIdx = ssObj.getActiveSheetIndex(), editedChanges = ssObj.XLEdit.saveEditingValue().EditedData,
dataSettings = ssObj.getDataSettings(sheetIdx)[0], isShowHeader = dataSettings.showHeader, dataSource = dataSettings.dataSource, changedDataSource = [], pushedRowColl = [];
activeCell = ssObj.getActiveCell(sheetIdx); // To get the activeCell for scrolling after post back
if (!editedChanges.length) {
ssObj.alert ("Please edit any cells and try again!");
return;
}
for (key in editedChanges) {
rowIdx = editedChanges[key].CellIndex.RowIndex;
if (isShowHeader)
rowIdx--;
if (pushedRowColl.indexOf(rowIdx) < 0) {
changedDataSource.push(dataSource[rowIdx]); // To get the changed data source.
pushedRowColl.push(rowIdx);
}
}
$.ajax({
type: "POST",
url: "SpreadsheetFeatures.aspx/Spreadsheet1_ServerCellSave",
data: JSON.stringify({ editedValues: JSON.stringify(changedDataSource) }),
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (response) {
// Success code here
},
error: function (err) {
// Error code here
}
});
});
</script> |
<WebMethod>
Public Shared Function Spreadsheet1_ServerCellSave(ByVal editedValues As String) As String
Dim serialize As JavaScriptSerializer = New JavaScriptSerializer()
Dim editedData As List(Of Orders) = serialize.Deserialize(Of List(Of Orders))(editedValues) // get the updated datasource
SpreadsheetObj.Sheets(0).RangeSetting(0).Datasource = editedData Return "Successfully updated"
End Function |
var activeCell = { rowIndex: 0, colIndex: 0 };
function loadComplete(args) {
var xlFormat = this.XLFormat;
if (!this.isImport) {
this.XLScroll.scrollToCell([activeCell.rowIndex,activeCell.colIndex,activeCell.rowIndex,activeCell.colIndex]) // To scroll the last updated cell.
}
} |
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.