jQWidgets Forums
jQuery UI Widgets › Forums › Grid › How Paging in ASP Classic
Tagged: asp grid, asp pagging, jqxgrid
This topic contains 3 replies, has 4 voices, and was last updated by zokanzi 9 years, 5 months ago.
Viewing 4 posts - 1 through 4 (of 4 total)
-
Author
-
please help me paging using classic asp
I use sql server databaseHi inukage,
Unfortunately, we do not have any samples with classic ASP, but for ASP .NET, ASP .NET MVC 3 & 4, please take a look at the ASP .NET Integration help topics here: http://www.jqwidgets.com/jquery-widgets-documentation/
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comHi inukage,
sample.asp
——————————————————————–<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%><%Dim OnurConn : Set OnurConn = Server.CreateObject("Adodb.Connection")OnurConn.Open "Provider=SQLNCLI10;Server=host;Database=db;Uid=user; Pwd=pass;"Dim TotalRS, TotalSet TotalRS = OnurConn.Execute("SELECT COUNT(ID) FROM Tablename") Total = TotalRS(0)TotalRS.CloseSet TotalRS = Nothing%><!doctype html><html><head><meta charset="utf-8"><title>Untitled Document</title> <link rel="stylesheet" href="jqwidgets/styles/jqx.base.css" type="text/css" /> <link rel="stylesheet" href="jqwidgets/styles/jqx.metro.css" type="text/css" /> <script type="text/javascript" src="scripts/jquery-1.8.2.min.js"></script> <script type="text/javascript" src="jqwidgets/jqxcore.js"></script> <script type="text/javascript" src="jqwidgets/jqxdata.js"></script> <script type="text/javascript" src="jqwidgets/jqxbuttons.js"></script> <script type="text/javascript" src="jqwidgets/jqxscrollbar.js"></script> <script type="text/javascript" src="jqwidgets/jqxmenu.js"></script> <script type="text/javascript" src="jqwidgets/jqxgrid.js"></script> <script type="text/javascript" src="jqwidgets/jqxgrid.sort.js"></script> <script type="text/javascript" src="jqwidgets/jqxgrid.filter.js"></script> <script type="text/javascript" src="jqwidgets/jqxcheckbox.js"></script> <script type="text/javascript" src="jqwidgets/jqxlistbox.js"></script> <script type="text/javascript" src="jqwidgets/jqxdropdownlist.js"></script> <script type="text/javascript" src="jqwidgets/jqxgrid.grouping.js"></script> <script type="text/javascript" src="jqwidgets/jqxgrid.selection.js"></script> <script type="text/javascript" src="jqwidgets/jqxgrid.pager.js"></script> <script type="text/javascript" src="jqwidgets/jqxpanel.js"></script> <script type="text/javascript" src="jqwidgets/jqxgrid.columnsresize.js"></script> <script type="text/javascript" src="jqwidgets/jqxgrid.columnsreorder.js"></script> <script type="text/javascript" src="scripts/gettheme.js"></script> <script type="text/javascript"> $(document).ready(function () { // prepare the data var theme = 'metro'; var source = { datatype: "json", datafields: [ { name: 'BasvuruID' }, { name: 'Tarih' }, { name: 'Durum' }, { name: 'islemDurumu' }, { name: 'TurID' }, { name: 'isim' }, { name: 'Telefon' }, { name: 'Kaynak' }, { name: 'UyeID' }, { name: 'GorusmeTarihi' } ], url: 'ajax/GetTable.asp', root: 'Rows', sortcolumn: 'Date', sortdirection: 'desc', beforeprocessing: function (data) { source.totalrecords = <%=Total%>; } }; var dataadapter = new $.jqx.dataAdapter(source); // initialize jqxGrid $("#jqxgrid").jqxGrid( { width: "100%", source: dataadapter, theme: theme, autoheight: true, pageable: true, virtualmode: true, columnsreorder: true, columnsresize: true, groupable: true, sortable: true, filterable: true, altrows: true, selectionmode: 'multiplerowsextended', rendergridrows: function () { return dataadapter.records; }, columns: [ { text: 'No', datafield: 'BasvuruID', width: "3%", pinned:true }, { text: 'Tarih', datafield: 'Tarih', width: "6%" }, { text: 'Durum', datafield: 'Durum', width: "5%" }, { text: 'Telefon', datafield: 'Telefon', width: "7%" }, { text: 'İşlem', datafield: 'islemDurumu', width: 180 }, { text: 'Kampanya', datafield: 'TurID', width: 100 }, { text: 'Başvuran', datafield: 'isim', width: "20%", pinned:true }, { text: 'Kaynak', datafield: 'Kaynak', width: 140 }, { text: 'Temsilci', datafield: 'UyeID', width: 140 }, { text: 'Görüşme Tarihi', datafield: 'GorusmeTarihi', width: 140 } ] }); }); </script></head><body class='default'> <div id='jqxWidget'> <div id="jqxgrid"></div> </div></body></html><%OnurConn.CloseSet OnurConn = Nothing%>
ajax/GetTable.asp
—————————————–<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%><%Response.Charset = "utf-8"Response.ContentType="application/json"Dim OnurConn : Set OnurConn = Server.CreateObject("Adodb.Connection")OnurConn.Open "Provider=SQLNCLI10;Server=host;Database=db;Uid=user; Pwd=pass;"Function IntKontrol(Deger) If (Deger = "") or (Not IsNumeric(Deger)) Then Deger = 0 Else Deger = Int(Deger) End If IntKontrol = DegerEnd FunctionDim p : p = IntKontrol(Request.QueryString("pagesize")) ' Bir sayfada kaç adet kayıt gösterilsinIf p = 0 Then p = 50Else p = CInt(p)End IfDim SayfaID : SayfaID = IntKontrol(Request.QueryString("pagenum")) ' Kaçıncı sayfaIf SayfaID = 0 Then SayfaID = 1Else SayfaID = CInt(SayfaID)End IfDim SayfaRS : Set SayfaRS = Server.CreateObject("ADODB.Recordset")SayfaRS.CursorType = 3SayfaRS.Open "SELECT ID, Tarih, TurID, isim, Telefon, Durum, utm_source, utm_medium, islemDurumu, UyeID, GorusmeTarihi FROM LandingBasvurular", OnurConnSayfaRS.PageSize = pIf Not SayfaRS.EOF Then SayfaRS.AbsolutePage = SayfaID Dim ToplamVeri : ToplamVeri = SayfaRS.RecordCount Dim ToplamSayfa : ToplamSayfa = SayfaRS.PageCount Dim strBlah2, SayfaSiniri If ToplamVeri < p Then SayfaSiniri = ToplamVeri Else SayfaSiniri = p End If Dim KayitSay : KayitSay = 1 Response.Write("[") for strBlah2 = 1 to SayfaSiniri If Not SayfaRS.EOF Then If KayitSay > 1 Then Response.Write(",") End If Response.Write("{") & VBCrlf Response.Write(" ""BasvuruID"": """&SayfaRS("ID")&""", ") & VBCrlf Response.Write(" ""Tarih"": """&SayfaRS("Tarih")&""", ") & VBCrlf Dim DurumRS Set DurumRS = OnurConn.Execute("SELECT Durum FROM Durumlar WHERE DurumID = " & SayfaRS("Durum")) If DurumRS.Eof Then Response.Write(" ""Durum"": ""Bekliyor"", ") & VBCrlf Else Response.Write(" ""Durum"": """&DurumRS("Durum")&""", ") & VBCrlf End If DurumRS.Close Set DurumRS = Nothing If SayfaRS("Durum") = 0 OR SayfaRS("Durum") = 1 Then Response.Write(" ""islemDurumu"": """", ") & VBCrlf Else If SayfaRS("islemDurumu") = 0 Then Response.Write(" ""islemDurumu"": ""Tarih gelmedi"", ") & VBCrlf ElseIf SayfaRS("islemDurumu") = 1 Then Response.Write(" ""islemDurumu"": ""İşlem uygulandı/uygulanacak"", ") & VBCrlf ElseIf SayfaRS("islemDurumu") = 2 Then Response.Write(" ""islemDurumu"": ""İşlem istemedi"", ") & VBCrlf End If End If Dim KampanyaRS Set KampanyaRS = OnurConn.Execute("SELECT Kampanya FROM Kampanyalar WHERE ID = " & SayfaRS("TurID")) If Not KampanyaRS.Eof Then Response.Write(" ""TurID"": """&KampanyaRS("Kampanya")&""", ") & VBCrlf End If KampanyaRS.Close Set KampanyaRS = Nothing Response.Write(" ""isim"": """&SayfaRS("isim")&""", ") & VBCrlf Response.Write(" ""Telefon"": """&SayfaRS("Telefon")&""", ") & VBCrlf Response.Write(" ""Kaynak"": """&SayfaRS("utm_source")&" ("&SayfaRS("utm_medium")&")"", ") & VBCrlf Dim TemsRS Set TemsRS = OnurConn.Execute("SELECT isim FROM Users WHERE UserID= " & SayfaRS("UserID")) If Not TemsRS.Eof Then Response.Write(" ""UyeID"": """&TemsRS("isim")&""", ") & VBCrlf End If TemsRS.Close Set TemsRS = Nothing Response.Write(" ""GorusmeTarihi"": """&SayfaRS("GorusmeTarihi")&"""") & VBCrlf Response.Write("}") SayfaRS.MoveNext KayitSay = KayitSay + 1 End If NextResponse.Write("]")End IfSayfaRS.CloseSet SayfaRS = NothingOnurConn.CloseSet OnurConn = Nothing%>
-
AuthorPosts
Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic.