Intersoft Studio 2014 - Web grid 8.0.7200.259 Delete/Paste not working

5 replies. Last post: June 23, 2014 4:10 AM by Hans Kristian
Tags :
  • (None)
  • New Discussion
  • New Question
  • New Product Feedback

Hi,

We have upgraded to Intersoft Studio 2014. Our grid version is 8.0.7200.259. However, after upgrading we are unable to delete/Paste rows any row from the grid. Hitting the delete or pasting the rows gives us the following java script error -

Unhandled exception at line 1, column 3427 in http://localhost/[mysite]/ISRes.axd?G/WebGrid_Core2.js/807200259

 

0x800a138f - JavaScript runtime error: Unable to get property 'length' of undefined or null reference

I error is coming in the java script code at : c<a.Data.length 

Below is the complete java script code.

Please let us know what needs to be done to support these functionalites working in our application.

Thanks,
Ravinder

function WebGridPersistedRows(){this._Type="WebGridPersistedRows";IWebGridPersistence.call(this);this.Table=null;this.Items=new Array();this.GetKeyValueString=function(a){if(this.Table==null){return}return WG50Engine.GetKeyValueString(this.Table,a)};this.Remove=function(b){if(this.Items.length==0||this.Table==null){return}var a=this.IndexOf(this.GetKeyValueString(b));if(a>-1){this.Items.splice(a,1)}};this.Add=function(d){var c=WG50Engine.GetTable(d);var a=null;var b=null;if(!this.IsRowValid(d)){return}if(c!=null){a=wgGetGridById(c.gridId);b=a.Tables[c.tblName]}if(this.Table==null){this.Table=b}this.Items.push(this.GetKeyValueString(d))};this.IsRowValid=function(a){if(a==null||a.parentElement==null||a.parentElement.parentElement==null){return false}return true};this.Contains=function(b){for(var a=0;a<this.Items.length;a++){if(this.Items[a]==this.GetKeyValueString(b)){return true}}return false};this.IndexOf=function(b){for(var a=0;a<this.Items.length;a++){if(this.Items[a]==b){return a}}return -1};this.SerializeToXml=function(){if(this.Items.length==0){return null}var a=this.Table.GetGrid();var e=a.XmlDt;var d=this.Table.XmlNode;var c=ISXml.CreateNodeOnly(e,"SelectedRows","");for(var b=0;b<this.Items.length;b++){ISXml.CreateCDATA(e,c,"Item",this.Items[b])}return c};this.Deserialize=function(d){for(var a=0;a<d.childNodes.length;a++){var c=d.childNodes[a].text;var e=c.split("\06");for(var b=0;b<e.length;b++){this.Items.push(e[b])}}};this.RefreshUI=function(f){var g;var a=this.Table.Grid;if(this.Table.IsRootTable){g=this.Table}else{g=f}if(a.LayoutSettings.RestoreRowSelection=="Disabled"){return}if(!g){return}var h=g.GetElement(WG40.BODY,WG40.HTMLTABLE);var e=h.rows;for(var b=0;b<e.length;b++){var d=e[b];if(wgIsRecordRow(d)){for(var c=0;c<this.Items.length;c++){if(this.GetKeyValueString(d)==this.Items[c]){this.Table.SelectedRows.push(d);WGEventEngine.RedrawSelectedRowBorder(d,"CheckedRow",false,true);if(this.Table.GetRowCheckerColumn()!=""){this.Table.ToRowObject(d).Check()}}}}}};this.Clear=function(){this.Items=new Array()}}function WebGridPersistedChildRows(){this._Type="WebGridPersistedChildRows";WebGridPersistedRows.call(this);this.SerializeToXml=function(){if(this.Items.length==0){return null}var a=this.Table.GetGrid();var e=a.XmlDt;var d=this.Table.XmlNode;var c=ISXml.CreateNodeOnly(e,"ChildRows","");for(var b=0;b<this.Items.length;b++){ISXml.CreateCDATA(e,c,"Item",this.Items[b])}return c};this.RefreshUI=function(a){}}function WebGridBatchUpdateSettings(){this._Type="WebGridBatchUpdateSettings";ISObject.call(this);this.AllowReviewChanges=false;this.AllowUndoChanges=true;this.AutomaticObjectUpdate=true;this.PromptOnUndoAllChanges=true;this.NotifyOnLostFocus=false;this.HighlightChanges=true;this.PromptUnsavedChanges=true}function WebGridBatchPendingChanges(){this._Type="WebGridBatchPendingChanges";IWebGridPersistence.call(this);this.Table=null;this.Items=new Array();this.GetKeyValueString=function(a){return WG50Engine.GetKeyValueString(this.Table,a)};this.Remove=function(a){var b=this.IndexOf(a);if(b>-1){this.Items.splice(b,1)}};this.Add=function(a){this.Items.push(a)};this.Get=function(c,d){var b=new Array();for(var a=0;a<this.Items.length;a++){if(c==null||(this.GetResolvedKeyValue(this.Items[a])==c.GetKeyValueString())){if(d){if(this.Items[a].RowState==d){b.push(this.Items[a])}}else{b.push(this.Items[a])}}}return b};this.GetResolvedKeyValue=function(a){for(var c=0;c<a.Data.length;c++){var b=a.Data[c];if(b.Column.IsPrimaryKey()){return b.NewValue}}return a.KeyValues};this.Contains=function(b){for(var a=0;a<this.Items.length;a++){if(this.Items[a].KeyValues==b.GetKeyValueString()){return true}}return false};this.IndexOf=function(a){for(var b=0;b<this.Items.length;b++){if(this.Items[b]==a){return b}}return -1};this.SerializeToXml=function(){if(this.Items.length==0){return null}var d=this.Table.GetGrid();var o=d.XmlDt;var m=this.Table.XmlNode;var k=ISXml.CreateNodeOnly(o,"PendingChanges","");for(var e=0;e<this.Items.length;e++){var f=this.Items[e];var g=ISXml.CreateNode(o,k,"Item","");var b="";if(f.Data!=null){for(var h=0;h<f.Data.length;h++){var a=f.Data[h];b+="<C>";b+="<N>"+a.Column.Name+"</N><NT>"+ISXml.EncodeString(a.NewText)+"</NT><NV>"+ISXml.EncodeString(a.NewValue.toString())+"</NV>";if(a.OldText!=""&&a.OldText!=null){b+="<OT>"+ISXml.EncodeString(a.OldText)+"</OT>"}if(a.OldValue!=""&&a.OldValue!=null){b+="<OV>"+ISXml.EncodeString(a.OldValue.toString())+"</OV>"}b+="</C>"}}var n=f.KeyValues.split("\03");var c="";for(var h=0;h<n.length;h++){if(n[h]!=""){c+="<V>"+n[h]+"</V>"}}if(!f.Table.IsRootTable&&f.ParentRowKeyValues!=null){n=f.ParentRowKeyValues.split("\03");var l="";for(var h=0;h<n.length;h++){if(n[h]!=""){l+="<V>"+n[h]+"</V>"}}ISXml.CreateCDATA(o,g,"ParentValue",l)}ISXml.SetAttribute(g,"RowState",f.RowState);ISXml.SetAttribute(g,"TableName",f.Table.Name);ISXml.CreateCDATA(o,g,"Value",c);ISXml.CreateCDATA(o,g,"Data",b);if(f.RowState=="Added"&&f.Row.SubTable!=null){ISXml.CreateCDATA(o,g,"RelNames",f.Row.SubTable.RelNames)}}return k};this.Deserialize=function(n){for(var f=0;f<n.childNodes.length;f++){var g=n.childNodes[f];var e=new WebGridRowChanges();e.RowState=ISXml.GetAttribute(g,"RowState");e.RequireInvalidate=true;e.Table=this.Table;var q=ISXml.GetNode(g,"Value");if(q!=null){var s=ISXml.CreateXmlDocument();var k=new Array();ISXml.LoadXml(s,"<Root>"+q.text+"</Root>");for(var h=0;h<s.documentElement.childNodes.length;h++){k.push(s.documentElement.childNodes[h].text)}e.KeyValues=k.join("\03")}var m=ISXml.GetNode(g,"Data");var r=ISXml.CreateXmlDocument();ISXml.LoadXml(r,"<Root>"+m.text+"</Root>");var d=ISXml.GetNodes(r,"//C");if(d!=null&&d.length>0){e.Data=new Array();for(var h=0;h<d.length;h++){var c=new WebGridCellData();var l=d[h];c.Column=this.Table.Columns.GetNamedItem(ISXml.GetNodeText(l,"N"));c.NewText=ISXml.DecodeString(ISXml.GetNodeText(l,"NT"));c.NewValue=ISXml.DecodeString(ISXml.GetNodeText(l,"NV"));c.OldText=ISXml.DecodeString(ISXml.GetNodeText(l,"OT"));c.OldValue=ISXml.DecodeString(ISXml.GetNodeText(l,"OV"));e.Data.push(c)}}if(e.RowState=="Added"){var o=this.Table.NewRow();if(this.Table.HasMultiPrimaryKey){var a=e.KeyValues.split("\03");o.KeyValues=new Array();for(var h=0;h<a.length;h++){o.KeyValues.push(a[h])}}else{o.KeyValue=e.KeyValues}for(var h=0;h<e.Data.length;h++){var c=e.Data[h];var b=o.Cells.GetNamedItem(c.Column.Name);if(b!=null){b.Modified=true;b.Text=c.NewText;b.Value=c.NewValue;b.OldText=c.OldText;b.OldValue=c.OldValue}}o.RelNames=WGBatchEngine.GetRelNamesString(o);if(!this.Table.IsRootTable){var p=new WebGridSubTables();p.RelNames=ISXml.GetNodeText(g,"RelNames");o.SubTable=p}e.Row=o}this.Items.push(e)}};this.RefreshUI=function(a){if(typeof(WGBatchEngine)!="undefined"){WGBatchEngine.RefreshUI(this,a)}};this.Invalidate=function(){var b=this.Table.Grid;for(var c=0;c<this.Items.length;c++){var a=this.Items[c];a.RequireInvalidate=true;a.Element=null;if(a.Row!=null){a.Row.RowElement=null}if(a.RowState!="Added"){if(b.BindingOperationMode=="ServerBinding"||b.IsClientBinding("Server")){a.Row=null}}}};this.Clear=function(){for(var b=0;b<this.Items.length;b++){var a=this.Items[b];a.Element=null;a.Row=null;this.Items[b]=null}this.Items=new Array()}}function WebGridCellData(){this._Type="WebGridCellData";ISObject.call(this);this.Column=null;this.OldValue=null;this.OldText=null;this.NewValue=null;this.NewText=null}function WebGridRowChanges(){this._Type="WebGridRowChanges";ISObject.call(this);this.RowState="";this.Element=null;this.Data=null;this.Row=null;this.KeyValues=null;this.RequireInvalidate=false;this.Table=null;this.ParentRowKeyValues=null;this.Setup=function(f){this.Element=f.GetElement();this.Row=f;this.KeyValues=this.Row.GetKeyValueString();this.Table=f.Table;if(!this.Table.IsRootTable&&this.Row!=null){var e=this.Row.GetParentRow();if(e!=null){this.ParentRowKeyValues=e.GetKeyValueString()}}if(this.RowState!="Deleted"){this.Data=new Array();var b=this.Row.GetCells();for(var d=0;d<b.length;d++){var a=b[d];if(a!=null&&(a.Modified&&a.Column.DataMember!="")){var c=new WebGridCellData();c.Column=a.Column;c.OldValue=a.OldValue;c.NewValue=a.Value;c.OldText=a.OldText;c.NewText=a.Text;if(a.Column.DataType=="System.Boolean"){if(c.NewValue==""||c.NewValue==false){c.NewValue="False"}else{if(c.NewValue==true){c.NewValue="True"}}if(c.OldValue==false){c.OldValue="False"}else{if(c.NewValue==true){c.NewValue="True"}}}this.Data.push(c)}}}};this.MergeChanges=function(f){this.Row=f;if(this.RowState=="Modified"||this.RowState=="Added"){var b=this.Row.GetCells();for(var e=0;e<b.length;e++){var a=b[e];if(a!=null&&a.Modified){var d=this.GetExistingData(a.Column.Name);if(d){d.NewValue=a.Value;d.NewText=a.Text}else{var c=new WebGridCellData();c.Column=a.Column;c.OldValue=a.OldValue;c.NewValue=a.Value;c.OldText=a.OldText;c.NewText=a.Text;this.Data.push(c)}}}}return true};this.GetExistingData=function(c){if(this.Data==null){return null}for(var b=0;b<this.Data.length;b++){var a=this.Data[b];if(a.Column.Name==c){return a}}return null};this.UndoUIChanges=function(f){if(this.Element!=null){if(this.RowState=="Added"){var j=this.Row.Table;var c=j.Grid;var k=WG50Engine.GetTable(this.Element);var d=null;var h=null;WGBatchEngine.DeleteSubTableCascade(j,this.Row);WGEditEngine.DeleteRowGeneric(c,j,k,this.Element);if(j.LastRowPosition>-1){j.LastRowPosition--}if(c.LayoutSettings.Hierarchical){var g=wgGetLastVisibleRow(k);if(g!=null){h=g.GetRowElement();WGEditEngine.FixTreeLines(c,j,k,h);WGEditEngine.MarkLastLines(c,j,k,h)}}}else{if(this.RowState=="Modified"&&!f){for(var e=0;e<this.Data.length;e++){var b=this.Data[e];var a=wgGetCellByName(this.Element,b.Column.Name);if(a!=null){a.cellModified=true;a.oldCellValue=b.OldValue;a.oldText=b.OldText}}WGEditEngine.CancelChanges(this.Element)}else{if(this.RowState=="Deleted"){}}}}}};
All times are GMT -5. The time now is 2:20 PM.
Previous Next