jQWidgets Forums

Forum Replies Created

Viewing 15 posts - 16 through 30 (of 40 total)
  • Author
    Posts

  • Gopre400
    Participant

    I’m confused Peter, you can not put aggregates in group header?


    Gopre400
    Participant

    I 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,

    in reply to: Escaping angle brackets Escaping angle brackets #54298

    Gopre400
    Participant

    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 Function

    Then 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”)

    in reply to: Escaping angle brackets Escaping angle brackets #54297

    Gopre400
    Participant

    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 Function

    But 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);
    }
    },

    in reply to: Escaping angle brackets Escaping angle brackets #54231

    Gopre400
    Participant

    Hi, I have a similar situation, left brackets “<” in text. How do I escape a data field in a grid?


    Gopre400
    Participant

    I 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;
    }

    in reply to: Size button in grid Size button in grid #50124

    Gopre400
    Participant

    Thank you Dimitar, it works great!


    Gopre400
    Participant

    Is 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’);

    in reply to: Size button in grid Size button in grid #49788

    Gopre400
    Participant

    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” });
    });

    in reply to: Size button in grid Size button in grid #49787

    Gopre400
    Participant

    Thanks Dimitar,

    The ready callback function of what? The grid? the document?


    Gopre400
    Participant
    var imagerenderer = function (row, datafield, value, defaulthtml, columnproperties, rowdata) {
          return '<img style="height="100" width="100" src="GetImageHandler.ashx"/>';
     }

    Gopre400
    Participant

    Thank 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 Sub

    in reply to: Binding Image from Database Binding Image from Database #49419

    Gopre400
    Participant

    Hi Peter,

    I looked at pinnedcolumns.htm but I didn’t see any column that was bound to an image, am I missing something?

    Thanks
    John


    Gopre400
    Participant

    Thank you!

    in reply to: Open Menu in Code Open Menu in Code #48540

    Gopre400
    Participant

    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’);

Viewing 15 posts - 16 through 30 (of 40 total)