Replies
Hi Denis,
What I am doing is slightly different than this. I don't have auto-commit turned on in the grid and I am using the REST settings to do the updates (http://www.igniteui.com/grid/rest-editing). It is difficult for me to give a working example because I don't have web services that can be accessed by you. Hopefully this additional bit of information will be helpful in taking this further though.
I am creating the grid from MVC in C# code, and here is what is getting rendered for the grid:
<div id="GridPlaceHolder" class="ScreenControlDataGrid sidebar-target-wrapper " data-name="MainUiScreenDetailSectionPartsGrid" data-internalid="35292">
<table data-controlId="35292" data-controlType="igGrid" data-defaultinsertbinding="[{"column":"ScreenId","binding":"ObjectId"}]" data-editable="True" data-noResultsMsg="Search produced no results." data-screenId="19991" data-showNoResultsMsg="False" data-widget="Grid" id="MainUiScreenDetailSectionPartsGrid"></table>
<script type="text/javascript">$(function () {$('#MainUiScreenDetailSectionPartsGrid').igGrid({ dataSource: '/SCALE/Detail/DetailsGridDataSourceBind?frmId=19991&tbl=Screen_Part&grdId=35292&modelClass=General.Mvc.Models.Detail.ScreenPartCrudGridModel&internalId=89',autoGenerateColumns: false,autoGenerateLayouts: false,mergeUnboundColumns: false, responseDataKey: 'Records', generateCompactJSONResponse: false, enableUTCDates: true, columns: [ { headerText: 'Object id', key: 'ObjectId', dataType: 'number', width: '100px', hidden: false, template: '<a href=\'/scale/details/screenpart/{{ObjectId}}\' target=\'_blank\'>{{ObjectId}}</a>' }, { headerText: 'Part name', key: 'PartName', dataType: 'string', width: '300px', hidden: false, template: null }, { headerText: 'Part type', key: 'PartType', dataType: 'string', width: '150px', hidden: false, template: null }, { headerText: 'Resource key', key: 'ResourceKey', dataType: 'string', width: '150px', hidden: false, template: null }, { headerText: 'Active', key: 'Active', dataType: 'bool', width: '75px', hidden: false, template: null }, { headerText: 'Sequence', key: 'Sequence', dataType: 'number', width: '100px', hidden: false, template: null }, { headerText: 'Default action', key: 'DefaultAction', dataType: 'string', width: '200px', hidden: false, template: null }, { headerText: 'Div css class', key: 'DivCssClass', dataType: 'string', width: '250px', hidden: false, template: null }, { headerText: 'Partial view', key: 'PartialView', dataType: 'bool', width: '75px', hidden: false, template: null }, { headerText: 'Screen id', key: 'ScreenId', dataType: 'number', width: '75px', hidden: true, template: null } ], features: [ { filterExprUrlKey: 'filter', filterLogicUrlKey: 'filterLogic', name: 'Filtering', type: 'remote', caseSensitive: false }, { name: 'GroupBy', resultResponseKey: 'GroupBy', groupByUrlKey: 'sort', groupByUrlKeyAscValue: 'asc', groupByUrlKeyDescValue: 'desc', type: 'remote', groupedColumnsChanged: function(evt,ui){_webUi.Grid.gridGroupedColumnsChanged(evt, ui)} }, { name: 'Hiding', columnHidden: function(evt,ui){_webUi.Grid.gridColumnHidden(evt, ui)}, columnShown: function(evt,ui){_webUi.Grid.gridColumnShown(evt, ui)} }, { name: 'ColumnMoving', mode: 'deferred', moveType: 'dom', columnMoved: function(evt,ui){_webUi.Grid.gridColumnMoved(evt, ui)} }, { name: 'Resizing', allowDoubleClickToResize: true, columnResized: function(evt,ui){_webUi.Grid.gridColumnSizeChanged(evt, ui)} }, { name: 'Selection', mode: 'row' }, { sortUrlKey: 'sort', sortUrlKeyAscValue: 'asc', sortUrlKeyDescValue: 'desc', name: 'Sorting', type: 'remote', mode: 'multiple', columnSorted: function(evt,ui){_webUi.Grid.gridColumnSorted(evt, ui)}, modalDialogClosed: function(evt,ui){_webUi.Grid.gridmodalDialogClosed(evt, ui)} }, { summaryExprUrlKey: 'Summaries', summariesResponseKey: 'Metadata.Summaries', name: 'Summaries', type: 'local' }, { recordCountKey: 'TotalRecordsCount', pageIndexUrlKey: 'page', pageSizeUrlKey: 'pageSize', name: 'Paging', pageSize: 50, type: 'remote', defaultDropDownWidth: '80px' }, { columnSettings: [ { columnIndex: -1, columnKey: 'ObjectId', readOnly: true }, { columnIndex: -1, columnKey: 'ScreenId', readOnly: true }, { columnIndex: -1, columnKey: 'PartName', required: true, validation: true, editorType: 'text', editorOptions: { button: 'clear', maxLength: 0 } }, { columnIndex: -1, columnKey: 'PartType', required: true, validation: true, editorType: 'combo', editorOptions: { allowCustomValue: false, caseSensitive: false, enableClearButton: true, filteringType: 'local', renderMatchItems: 'multi', textKey: 'DisplayText', valueKey: 'Identifier', dataSource: [{"Identifier":"10","Description":"Div Container","DisplayText":"Div Container","IsDescUsedForDisplay":true},{"Identifier":"20","Description":"ModalDialog","DisplayText":"ModalDialog","IsDescUsedForDisplay":true}] } }, { columnIndex: -1, columnKey: 'ResourceKey', required: false, validation: true, editorType: 'text', editorOptions: { button: 'clear', maxLength: 0 } }, { columnIndex: -1, columnKey: 'Active', required: false, validation: true }, { columnIndex: -1, columnKey: 'Sequence', required: true, validation: true, editorType: 'numeric', editorOptions: { button: 'clear', dataMode: 'int', maxDecimals: 0, maxValue: 99999, minDecimals: 0, minValue: -99999, regional: 'en-US' } }, { columnIndex: -1, columnKey: 'DefaultAction', required: false, validation: true, editorType: 'text', editorOptions: { button: 'clear', maxLength: 50 } }, { columnIndex: -1, columnKey: 'DivCssClass', required: false, validation: true, editorType: 'text', editorOptions: { button: 'clear', maxLength: 0 } }, { columnIndex: -1, columnKey: 'PartialView', required: false, validation: true } ], name: 'Updating', enableAddRow: true, editMode: 'row', enableDeleteRow: true, rowAdding: function(evt,ui){_webUi.detailsScreenBinding.fillGridRequiredColumnsOnAddRow(evt, ui)} } ], alternateRowStyles: true, height: '100%', width: '100%', autoFormat: 'dateandnumber', rest: true, restSettings: { update: { url: '/general/scaleapi/screenPartApi/save' }, create: { url: '/general/scaleapi/screenPartApi/save' }, remove: { url: '/general/scaleapi/screenPartApi/delete' } }, primaryKey: 'ObjectId', fixedHeaders: true, renderCheckboxes: true, localSchemaTransform: false, rendering: function(evt,ui){_webUi.Grid.gridrendering(evt, ui)}, dataBound: function(evt,ui){_webUi.Grid.gridDataBound(evt, ui)}, rowsRendered: function(evt,ui){_webUi.Grid.gridRowsRendered(evt, ui)}, dataDirty: function(evt,ui){_webUi.Grid.gridUpdatingDataDirty(evt, ui)} });});</script>
<script type="text/javascript">$(function () {
if (typeof _webUi.Grid.enableCommitActionForEditableGrid === 'function') { $(document).delegate('#MainUiScreenDetailSectionPartsGrid', 'iggridupdatingrowdeleted',{'CommitSelector' : 'li.menubuttonsave'} ,_webUi.Grid.enableCommitActionForEditableGrid)} })</script><script type="text/javascript">$(function () {
if (typeof _webUi.Grid.enableCommitActionForEditableGrid === 'function') { $(document).delegate('#MainUiScreenDetailSectionPartsGrid', 'iggridupdatingrowadded',{'CommitSelector' : 'li.menubuttonsave'} ,_webUi.Grid.enableCommitActionForEditableGrid)} })</script><script type="text/javascript">$(function () {
if (typeof _webUi.Grid.enableCommitActionForEditableGrid === 'function') { $(document).delegate('#MainUiScreenDetailSectionPartsGrid', 'iggridupdatingeditrowended',{'CommitSelector' : 'li.menubuttonsave'} ,_webUi.Grid.enableCommitActionForEditableGrid)} })</script>
<script type="text/javascript">$(function () {
$('#MainUiScreenDetailSectionPartsGrid').attr({
'data-modelClass': "General.Mvc.Models.Detail.ScreenPartCrudGridModel",
'data-dbtable': "Screen_Part",
'data-headerkey': "Screen_Id"
});})</script>
</div>
I'm hoping to get back to this task soon. I'll let you know once I do.
Thanks for the suggestion. I tried with the textChanged event, and the "enter" key only fires this event when the user types in a value and then hits enter. If I simply put focus on the combo box and hit enter, the event is not fired. Also if a value is chosen and I select it using mouse from the drop down, and then hit enter, the event is not fired either. Am I missing something?