爪哇哇

          一個(gè)軟件分析師的博客

          近期負(fù)責(zé)公司的OA改造,接觸了ext-js框架,自己動(dòng)手寫(xiě)了些代碼,最有成就感的是 extnd里分頁(yè)的修改,一下是部分修改心得

          一:

          分頁(yè)要自己重寫(xiě):在 extnd-all-debug重寫(xiě)拿取數(shù)據(jù)部分

          //自己重寫(xiě)分頁(yè)拿數(shù)據(jù)的方法,這樣數(shù)據(jù)行數(shù)會(huì)正確現(xiàn)實(shí)
            var ds = new Ext.nd.data.DominoViewStore({
                    proxy: new Ext.data.HttpProxy({
                        url: Ext.nd.extndUrl+'GetView?OpenAgent',
                        method: "GET"
                    }),
                    baseParams: {db: "/"+Ext.nd.Session.CurrentDatabase.FilePath, vw: this.viewName },
                    reader: viewEntryReader,
                    remoteSort: true
                });

          。。。。。。。。。。。。。。。

          getView的ls代理如下

          'GetView:

          Option Public
          Option Explicit


          Sub Initialize
          %REM
          This agent can be called from the web to search any view and return results in the
          same format as the ?ReadViewEntries command. This was created for use with the
          NotesView2 class v1.3 and above.
          %END REM
           
           On Error Goto ErrorHandler
           
           Dim session As New NotesSession
           Dim dbSearch As NotesDatabase
           Dim colEntries As NotesViewEntryCollection
           Dim vwSearch As NotesView
           Dim entryResult As NotesViewEntry
           Dim docCurrent As NotesDocument
           Dim docResult As NotesDocument
           Dim col As NotesViewColumn
           Dim strQuery As String
           Dim strDb As String
           Dim strView As String
           Dim strCategory As String
           Dim intMax As Integer
           Dim lngCount As Long, i As Long
           Dim lngStart As Long, lngEnd As Long
           Dim strParameters As String
           Dim lngResults As Long
           Dim x,n As Integer
           Dim xmlStr,resortdescending ,resortascending As String
           Dim nav As NotesViewNavigator
           
           
           'start the xml document
           Print "Content-Type:text/xml;"
           Print "<?xml version=""1.0"" encoding=""gb2312""?>"
           
           'first we get the search parameters out of the querystring
           'db, vw, query, searchmax, count, and start
           Set docCurrent = session.DocumentContext
           
           strParameters = docCurrent.GetItemValue("Query_String")(0)
           'Msgbox strParameters
           strDb = GetParameter("db",strParameters)
           strDb = Replace(Strright(strDb,"/"),"/","\")
           strView = GetParameter("vw",strParameters)
           strQuery = GetParameter("query",strParameters)
           strCategory= GetParameter("RestrictToCategory",strParameters)
           resortdescending=GetParameter("resortdescending",strParameters)
           resortascending=GetParameter("resortascending",strParameters)
           
           intMax = 0
           If Isnumeric(GetParameter("searchmax",strParameters)) Then intMax = Cint(GetParameter("searchmax",strParameters))
           lngCount = 20
           If Isnumeric(GetParameter("count",strParameters)) Then lngCount = Clng(GetParameter("count",strParameters))
           lngStart = 1
           If Isnumeric(GetParameter("start",strParameters)) Then lngStart = Clng(GetParameter("start",strParameters))
           
           'now we get the view to search
           Set dbSearch = session.GetDatabase("",strDb,False)
           Set vwSearch = dbSearch.GetView(strView)
           
           'Msgbox resortdescending +" && "+resortascending
           
           'now we run the search
           If   strCategory="" Then
            
            Set colEntries = vwSearch.AllEntries 
           Else
            Set colEntries = vwSearch.GetAllEntriesByKey(strCategory)
           End If 
           
           lngResults=colEntries.Count
           
           
           'now we spit out the results
           Print "<viewentries toplevelentries=""" & Cstr(lngResults) & """>"
           
           
           'set the starting point for the loop
           If lngStart > lngResults Then lngStart = lngResults
           
           'set the ending point for the loop
           lngEnd = lngStart + lngCount - 1
           If lngEnd > lngResults Then lngEnd = lngResults
           'now loop through the appropriate subset of results and print out a viewentry tag for each one
           i = lngStart
           While i <= lngEnd
            
            If i = lngStart Then
             Set entryResult = colEntries.GetNthEntry(i) 
            Else
             Set entryResult = colEntries.GetNextEntry(entryResult)
            End If
            
            
            If Not entryResult Is Nothing   Then
            'If Not entryResult Is Nothing And entryResult.IsValid  Then
             'If entryResult.IsDocument Then
             Set docResult = entryResult.Document
             Print  "<viewentry position=""" & Cstr(i) & """ unid=""" & Cstr(docResult.universalID) & """ noteid=""" & Cstr(docResult.NoteID) & """ siblings=""" & Cstr(entryResult.SiblingCount) & """>"
             x = 0
             n=0
             Forall value In entryResult.ColumnValues
              Set col=vwSearch.Columns(x)
              
              If Not col.isCategory And  Not col.IsHidden  Then
               Print "<entrydata columnnumber=""" & Cstr(n) & """ name=""" & col.itemName & """>"
               Print  "<text>" & XMLEscape(GetValue(value,Cstr(docResult.universalID))) & "</text>"
               Print  "</entrydata>"
               n=n+1
              End If
              x = x + 1
             End Forall
             Print "</viewentry>"
             'End If
            End If
            i = i + 1
           Wend
          AtEnd:
           Print "</viewentries>"
           
           ''''Msgbox xmlStr
           Print xmlStr
           vwSearch.Clear
           Set dbSearch=Nothing
           Set vwSearch=Nothing
           Exit Sub
          ErrorHandler:
           Msgbox "<error>" & "Error in ($Ext.nd.SearchView): " & Error & "---at " & Erl & "</error>"
           Print "<error>" & "Error in ($Ext.nd.SearchView): " & Error & "---at " & Erl & "</error>"
           Resume AtEnd
          End Sub
          Function GetParameter(strParamName As String, strQuery As String) As String
           'this gets a parameter out of a querystring
           Dim i As Integer
           Dim s As String
           Dim v As Variant
           
           GetParameter = ""
           
           i = Instr(Ucase(strQuery),"&" & Ucase(strParamName) & "=")
           If i <> 0 Then
            s = Strright(Mid(strQuery, i),"=")
            If Instr(s, "&") Then
             s = Strleft(s, "&")
            End If
            v = Evaluate("@UrlDecode(""Domino""; """ & s & """)")
            GetParameter = Cstr(v(0))
           End If
          End Function
          Function XMLEscape(strValue As String) As String
           'this escapes a string so it can be printed out to xml safely
           strValue = Replace(strValue, "&" , "&amp;")
           strValue = Replace(strValue, "<" , "&lt;")
           strValue = Replace(strValue, ">" , "&gt;")
           XMLEscape = strValue
          End Function


          Function GetValue(strValue As Variant,id As String) As String
           On Error Goto sErr
           
           'Forall vs In strValue
           ' Msgbox "vs=" &  Cstr(vs)
           'End Forall
           GetValue=Cstr(strValue)
           Exit Function
          sErr:
           GetValue="文檔" & id
           Exit Function
          End Function

           

          有興趣可以研究下 ext-js的AJAX框架,確實(shí)很有趣

          posted on 2007-12-29 14:32 李立波 閱讀(1933) 評(píng)論(1)  編輯  收藏 所屬分類: DOMINO

          Feedback

          # re: 近期負(fù)責(zé)公司的OA改造,接觸了ext-js框架,自己動(dòng)手寫(xiě)了些代碼,最有成就感的是 extnd里分頁(yè)的修改,一下是部分修改心得 2008-11-19 18:31 Mingle

          您好!想了解下你使用的extjs哪個(gè)版本?1.0?2.0?2.01?2.2?修改ExtND中的分頁(yè),主要解決了哪些問(wèn)題呢?切盼您的指導(dǎo)和分享。謝謝!eMail:dominonotes@163.com  回復(fù)  更多評(píng)論   


          My Links

          Blog Stats

          News

          常用鏈接

          留言簿(5)

          隨筆分類

          隨筆檔案

          文章檔案

          相冊(cè)

          搜索

          最新評(píng)論

          閱讀排行榜

          評(píng)論排行榜

          主站蜘蛛池模板: 沾益县| 毕节市| 芮城县| 大宁县| 呈贡县| 巫山县| 临湘市| 邳州市| 弥渡县| 大同县| 新泰市| 玛曲县| 乌兰察布市| 普安县| 昌平区| 大同市| 明溪县| 登封市| 湟中县| 云龙县| 格尔木市| 车致| 武邑县| 融水| 克拉玛依市| 容城县| 定兴县| 独山县| 桐庐县| 瓦房店市| 怀来县| 河源市| 怀远县| 塔城市| 宝山区| 桂林市| 绥芬河市| 惠水县| 柏乡县| 同江市| 茂名市|