PDA

View Full Version : [CLOSED] GridPanel disappear code-behind



mis@adphk.com
Jan 18, 2013, 8:54 AM
When I refresh gridpanel it will disappear

case 1: directclick refresh and wait around 1 second -> gridpanel is work fine
case 2: directclick refresh and wait less then 1 second -> gridpanel is disappear and never show again until refresh browser

I am using List Of <T> to fill in the Store and call gridpanel.Render


Public Sub FillLstOfDataToGridPanel(Of t)(ByVal objLstOf As List(Of t), Optional ByVal strShowHideColNameList As String = Nothing, Optional ByVal strIDProperty As String = Nothing, Optional blnTIsShowFIsHide As Boolean = False, Optional strColumnAlias As String = Nothing )
Dim objLstOfProp As List(Of clsNameAndProperty)
Dim objModel As New Ext.Net.Model
Dim objExtCol As Ext.Net.Column
Dim objExtDateCol As Ext.Net.DateColumn

Dim i As Integer
Dim blnShowIt As Boolean
Dim strSplit() As String

Dim strText As String
Dim strAlias() As String


If objLstOf.Count < 1 Then
mExtNetStore.Reader.Clear()
objModel.Fields.Clear()
mExtNetGridPanel.RemoveAllColumns()
Exit Sub
End If


objLstOfProp = getListOfProperty(objLstOf(0))
mExtNetStore.DataSource = objLstOf
mExtNetGridPanel.RemoveAllColumns()
objModel = FillLstOfObjectToModel(objLstOfProp, strIDProperty)

If mExtNetGridPanel.StoreID Is Nothing OrElse mExtNetGridPanel.StoreID.Trim = "" Then
mExtNetGridPanel.StoreID = mExtNetStore.ID
End If
strAlias = Split(strColumnAlias, ",")
strSplit = Split(strShowHideColNameList, ",")
For i = 0 To objLstOfProp.Count - 1
blnShowIt = False
If strShowHideColNameList Is Nothing OrElse strShowHideColNameList.Trim = "" Then
blnShowIt = True
Else
Dim query = From obj As String In strSplit Where obj = objLstOfProp(i).Name.Trim

If query.Count > 0 Then
If blnTIsShowFIsHide = True Then
blnShowIt = True
Else
blnShowIt = False
End If
End If
End If
Dim strPropertyName As String
strPropertyName = objLstOfProp(i).Name
strText = ""
If strColumnAlias Is Nothing OrElse strColumnAlias.Trim = "" Then
strText = strPropertyName
Else
strText = strPropertyName
Dim CheckEqu As Char() = New Char() {"="}
Dim AliasQuery = From objAlias As String In strAlias Where objAlias.Split("=")(0).Trim = strPropertyName.Trim

If AliasQuery.Count > 0 Then
For Each objResult In AliasQuery
strText = objResult.ToString.Split("=")(1)
Next
End If
End If

If blnShowIt = True Then
If objLstOfProp(i).ExtNetModelType = Ext.Net.ModelFieldType.Date Then
objExtDateCol = New Ext.Net.DateColumn
objExtDateCol.Text = strText ''objLstOfProp(i).Name
objExtDateCol.DataIndex = objLstOfProp(i).Name
objExtDateCol.Format = "yyyy/MM/dd"
mExtNetGridPanel.AddColumn(objExtDateCol)
Else
objExtCol = New Ext.Net.Column
objExtCol.Text = strText ''objLstOfProp(i).Name
objExtCol.DataIndex = objLstOfProp(i).Name
mExtNetGridPanel.AddColumn(objExtCol)
End If
End If
Next
mExtNetStore.Model.Clear()
mExtNetStore.Model.Add(objModel)
mExtNetStore.RebuildMeta()
mExtNetStore.DataBind()
mExtNetGridPanel.DataBind()
mExtNetGridPanel.Render()
End Sub

Daniil
Jan 18, 2013, 11:35 AM
Hi @mis@adphk.com,

Well, this is actual for any post.
http://forums.ext.net/showthread.php?23041&p=100564&viewfull=1#post100564

Please wrap.

mis@adphk.com
Jan 21, 2013, 1:44 AM
Public Sub FillLstOfDataToGridPanel(Of t)(ByVal objLstOf As List(Of t), Optional ByVal strShowHideColNameList As String = Nothing, Optional ByVal strIDProperty As String = Nothing, Optional blnTIsShowFIsHide As Boolean = False, Optional strColumnAlias As String = Nothing )
Dim objLstOfProp As List(Of clsNameAndProperty)
Dim objModel As New Ext.Net.Model
Dim objExtCol As Ext.Net.Column
Dim objExtDateCol As Ext.Net.DateColumn

Dim i As Integer
Dim blnShowIt As Boolean
Dim strSplit() As String

Dim strText As String
Dim strAlias() As String


If objLstOf.Count < 1 Then
mExtNetStore.Reader.Clear()
objModel.Fields.Clear()
mExtNetGridPanel.RemoveAllColumns()
Exit Sub
End If


objLstOfProp = getListOfProperty(objLstOf(0))
mExtNetStore.DataSource = objLstOf
mExtNetGridPanel.RemoveAllColumns()
objModel = FillLstOfObjectToModel(objLstOfProp, strIDProperty)

If mExtNetGridPanel.StoreID Is Nothing OrElse mExtNetGridPanel.StoreID.Trim = "" Then
mExtNetGridPanel.StoreID = mExtNetStore.ID
End If
strAlias = Split(strColumnAlias, ",")
strSplit = Split(strShowHideColNameList, ",")
For i = 0 To objLstOfProp.Count - 1
blnShowIt = False
If strShowHideColNameList Is Nothing OrElse strShowHideColNameList.Trim = "" Then
blnShowIt = True
Else
Dim query = From obj As String In strSplit Where obj = objLstOfProp(i).Name.Trim

If query.Count > 0 Then
If blnTIsShowFIsHide = True Then
blnShowIt = True
Else
blnShowIt = False
End If
End If
End If
Dim strPropertyName As String
strPropertyName = objLstOfProp(i).Name
strText = ""
If strColumnAlias Is Nothing OrElse strColumnAlias.Trim = "" Then
strText = strPropertyName
Else
strText = strPropertyName
Dim CheckEqu As Char() = New Char() {"="}
Dim AliasQuery = From objAlias As String In strAlias Where objAlias.Split("=")(0).Trim = strPropertyName.Trim

If AliasQuery.Count > 0 Then
For Each objResult In AliasQuery
strText = objResult.ToString.Split("=")(1)
Next
End If
End If

If blnShowIt = True Then
If objLstOfProp(i).ExtNetModelType = Ext.Net.ModelFieldType.Date Then
objExtDateCol = New Ext.Net.DateColumn
objExtDateCol.Text = strText ''objLstOfProp(i).Name
objExtDateCol.DataIndex = objLstOfProp(i).Name
objExtDateCol.Format = "yyyy/MM/dd"
mExtNetGridPanel.AddColumn(objExtDateCol)
Else
objExtCol = New Ext.Net.Column
objExtCol.Text = strText ''objLstOfProp(i).Name
objExtCol.DataIndex = objLstOfProp(i).Name
mExtNetGridPanel.AddColumn(objExtCol)
End If
End If
Next
mExtNetStore.Model.Clear()
mExtNetStore.Model.Add(objModel)
mExtNetStore.RebuildMeta()
mExtNetStore.DataBind()
mExtNetGridPanel.DataBind()
mExtNetGridPanel.Render()
End Sub

Daniil
Jan 21, 2013, 5:51 AM
Thank you for wrapping.


When I refresh gridpanel it will disappear

case 1: directclick refresh and wait around 1 second -> gridpanel is work fine
case 2: directclick refresh and wait less then 1 second -> gridpanel is disappear and never show again until refresh browser


I don't understand well what you mean under "wait around 1 second" and "wait less than 1 second".

Wait after a click on the refresh button? Ok, this seems clear. But wait before what? Maybe, before another click on the refresh button?

Please clarify.

Also a code sample is, unfortunately, incomplete to test with.

mis@adphk.com
Jan 21, 2013, 10:01 AM
seems firefox version issue, i run same code in IE 9 and firefox 18.0.1 is fine!
Thanks

Daniil
Jan 21, 2013, 10:47 AM
seems firefox version issue, i run same code in IE 9 and firefox 18.0.1 is fine!

This phrase is confusing. First you are saying it is a FireFox issue, then saying that it is fine with FireFox 18.0.1.

So, what FireFox issue is the issue reproducible with?

Please clarify.

mis@adphk.com
Jan 22, 2013, 1:50 AM
my firefox previous version not 18.0.1 , but i not sure which version is

Daniil
Jan 22, 2013, 6:44 AM
Recently, we have added a fix for FireFox 18. Maybe it affects this issue.

Or, maybe, FireFox fixed it itself.

Anyway it appears to be not a problem anymore, doesn't?

mis@adphk.com
Jan 22, 2013, 7:02 AM
ok now! thanks, but i face the other problem on 2.0 upgrade to 2.1.1 gridpanel.Render error, and I already create a new post http://forums.ext.net/showthread.php?23142-Gridpanel-Render-error-on-Ext-2-1-1