jQWidgets Forums
Forum Replies Created
-
Author
-
May 20, 2014 at 2:51 pm in reply to: TreeGrid Group Aggregate in header TreeGrid Group Aggregate in header #54699
I’m confused Peter, you can not put aggregates in group header?
May 16, 2014 at 7:03 pm in reply to: TreeGrid Column Cells Alignment TreeGrid Column Cells Alignment #54575I see this was a few months ago, but does cellsAlign work in Tree Grid?
Despite adding cellsAlign: ‘right’, the column still aligns left…
{ text: ‘Bid Total’, datafield: ‘BidTotal’, align: ‘right’, cellsAlign: ‘right’, cellsformat: ‘c2’, editable: false, width: 100,
I got it to work…first remove the escape in the code behind…
Public Function GetSRQViewStreetPlatesGrid() As String
Dim cmd As New SqlCommand()
cmd.CommandType = CommandType.StoredProcedure
cmd.CommandText = “spSRQRequestsStreetPlatesOpen”
Dim data As DataSet = GetSRQViewStreetPlatesData(cmd)
Dim dt As DataTable
dt = data.Tables(0)
Dim writer As New System.IO.StringWriter()
dt.WriteXml(writer, XmlWriteMode.WriteSchema, False)
Return writer.ToString()
End FunctionThen return cellsrenderer like this…
{ text: ‘Text’, datafield: ‘SignText’, width: 200, editable: false, cellsrenderer: function(row, columnfield, value, defaulthtml, columnproperties, rowdata) {
return rowdata.SignText.replace(“<“, less than code).replace(“>”, greater than code);
}
},(because this is html I wrote out “less than code”)
Thank you Peter, I looked at the link you provided but it doesn’t really answer the question. It says you need to encode the characters which I have done doing this…
Public Function GetSRQViewStreetPlatesGrid() As String
Dim cmd As New SqlCommand()
cmd.CommandType = CommandType.StoredProcedure
cmd.CommandText = “spSRQRequestsStreetPlatesOpen”
Dim data As DataSet = GetSRQViewStreetPlatesData(cmd)
Dim dr As DataRow
Dim dt As DataTable
dt = data.Tables(0)
For Each dr In dt.Rows
dr(“SignText”) = Uri.EscapeDataString(dr(“SignText”))
Next
Dim writer As New System.IO.StringWriter()
dt.WriteXml(writer, XmlWriteMode.WriteSchema, False)
Return writer.ToString()
End FunctionBut how do you decode the characters to display in a grid? I tried using the unescape function but does not work (data with < does not display).
{ text: ‘Text’, datafield: ‘SignText’, width: 200, editable: false, cellsrenderer: function(row, columnfield, value, defaulthtml, columnproperties, rowdata) {
return unescape(rowdata.SignText);
}
},Hi, I have a similar situation, left brackets “<” in text. How do I escape a data field in a grid?
April 30, 2014 at 9:27 pm in reply to: Show Row Number in column of grid Show Row Number in column of grid #53799I got it to work doing this…
{ text: ‘Item #’, datafield: ‘RowIndex’ , width: 50, cellsrenderer: rownumberrenderer },var rownumberrenderer = function (row, columnfield, value, defaulthtml, columnproperties, rowdata) {
return row + 1;
}Thank you Dimitar, it works great!
February 25, 2014 at 6:27 pm in reply to: Get Data when onClick of button in Group Header Get Data when onClick of button in Group Header #50122Is there a way to use the getgroup method to get data by clicking on the group header?
How do I get the current group index?
var group = $(‘#jqxgrid’).jqxGrid(‘getgroup’, ???);
$(‘body’).data(‘requestid’, group.group);
$(‘#popCompleteRequest’).popup(‘open’);I tried this, but it didn’t change anything…
$(“#jqxgrid”).ready(function () {
$(“#jqxgrid .jqx-button”).css({ “height”: “10px”});
});this too…
$(document).ready(function () {
$(“#jqxgrid .jqx-button”).css({ “height”: “10px” });
});Thanks Dimitar,
The ready callback function of what? The grid? the document?
February 18, 2014 at 10:56 pm in reply to: Retrieve image from SQL display in grid Retrieve image from SQL display in grid #49708var imagerenderer = function (row, datafield, value, defaulthtml, columnproperties, rowdata) { return '<img style="height="100" width="100" src="GetImageHandler.ashx"/>'; }
February 18, 2014 at 10:48 pm in reply to: Retrieve image from SQL display in grid Retrieve image from SQL display in grid #49703Thank you Peter, here is what I came up with for those that are curious. It works great.
Image renderer:
var imagerenderer = function (row, datafield, value, defaulthtml, columnproperties, rowdata) {
return;
}column in grid:
{ text: ‘Image’, datafield: ‘RequestedImage’, width: 100, cellsrenderer: imagerenderer },GetImageHandler.ashx
Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest
Dim signid As String = context.Request.QueryString(“signid”).ToString
Using con As New SqlConnection(GetConnectionString(“myconnection”))
Using cmd As New SqlCommand()
cmd.CommandType = CommandType.StoredProcedure
cmd.CommandText = “spSRQSignWithImageBySignID”
cmd.Parameters.AddWithValue(“@pSignID”, signid)
cmd.Connection = con
con.Open()
Dim sdr As SqlDataReader = cmd.ExecuteReader()
If sdr.HasRows Then
While sdr.Read()
Dim imageBytes As Byte() = DirectCast(sdr(2), Byte())
context.Response.ContentType = “image/jpeg”
context.Response.BinaryWrite(imageBytes)
End While
Else
context.Response.StatusCode = 404
End If
con.Close()
End Using
End Using
End SubFebruary 12, 2014 at 10:38 pm in reply to: Binding Image from Database Binding Image from Database #49419Hi Peter,
I looked at pinnedcolumns.htm but I didn’t see any column that was bound to an image, am I missing something?
Thanks
JohnFebruary 12, 2014 at 10:17 pm in reply to: Pass value from combobox to server side code Pass value from combobox to server side code #49418Thank you!
Thanks Dimitar, when I put the $(“#popHeadMenu”).jqxMenu(‘open’); in the onclick event it didn’t work. Here is what I did instead…
<div data-role=”page” data-theme=”b”>
<div data-role=”header” data-theme=”b”>
Portal
<h1>Current Requests</h1>
Menu
</div>
<div data-role=”content” data-theme=”b”>
<div id=’jqxWidget’>
<div id=’jqxMenu’ >
<ul id=’ulHeadMenu’>
<li id=’liAddRequest’>Add Request
<li id=’liViewRequests’>View Current Requests
<li id=’liViewVehicleRequests’>View Vehicle Requests</div>
</div>
</div>
</div>
<script type=”text/javascript”>
$(“#jqxMenu”).jqxMenu({
width: ‘200px’,
height: ‘140px’,
autoOpenPopup: false,
mode: ‘popup’
});
$(“#jqxMenu”).jqxMenu(‘setItemOpenDirection’, ‘jqxMenu’, ‘left’, ‘down’);$(“#btnHeadMenu”).bind(‘mousedown’, function (event) {
var scrollTop = $(window).scrollTop();
var scrollLeft = $(window).scrollLeft();
$(“#jqxMenu”).jqxMenu(‘open’, parseInt(event.clientX) + 5 + scrollLeft, parseInt(event.clientY) + 5 + scrollTop);
return false;
});
</script>However I can’t change the direction the menu opens. I have tried adjusting the variable in this method with no luck…
$(“#jqxMenu”).jqxMenu(‘setItemOpenDirection’, ‘jqxMenu’, ‘left’, ‘down’); -
AuthorPosts