jQWidgets Forums

jQuery UI Widgets Forums Grid how to pass parameters to web function in jqxgrid

This topic contains 3 replies, has 2 voices, and was last updated by  cfernandes 10 years, 12 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author

  • cfernandes
    Participant

    I want to pass the parameter value of a website can not function more. See the code below:

    GRID

    $(document).ready(function () {
                                   var g = $("input[id$='txtGestorPos']").val(); 
                                  var source = 
                                {
                               datatype: "json",
                                data: JSON.stringify({gestor:g}) ,
                                datafields:
                                 [
                                     { name: 'ID', type: 'number' },
                                     { name: 'NrRegisto', type: 'number' },
                                     { name: 'NrEstabelecimento', type: 'string' },
                                     { name: 'NomeEstabelecimento', type: 'string' },
                                     { name: 'TipoEstabelecimento', type: 'string' },
                                     { name: 'Contacto', type: 'string' },
                                     { name: 'Endereco', type: 'string' },
                                     { name: 'CoordenadasGPS', type: 'string' },
                                     { name: 'DataOperacao', type: 'date' },
                                 ],
                                 url: "RegistoVisitasPos.aspx/VisitasAnteriores"
                             };
                         var dataAdapter = new $.jqx.dataAdapter(source, { contentType: 'application/json; charset=utf-8' });
                         $("#jqxGridPreviousVisit").jqxGrid(
                        { 
                           height:300,
                           width: 720,
                           source : dataAdapter, 
                           showfilterrow: true,
                            filterable: true, 
                           sortable: true, 
                          pageable: true,
                            columns: [
                           { text: 'ID', datafield: 'ID', hidden: true },
                            { text: 'Nº da Visita', columntype: 'textbox', filtertype: 'textbox', filtercondition: 'starts_with', datafield: 'NrRegisto', width: 100 },
                              { text: 'Nº do Comerciante', columntype: 'textbox', filtertype: 'textbox', filtercondition: 'starts_with', datafield: 'NrEstabelecimento', width: 150 },
                             { text: 'Nome do Comerciante', columntype: 'textbox', filtertype: 'textbox', filtercondition: 'starts_with', datafield: 'NomeEstabelecimento', width: 270 },
                              { text: 'TipoEstabelecimento', datafield: 'TipoEstabelecimento', hidden: true },
                              { text: 'Contacto', datafield: 'Contacto', hidden: true },
                              { text: 'Endereco', datafield: 'Endereco', hidden: true },
                              { text: 'Coordenadas GPS', datafield: 'CoordenadasGPS', hidden: true },
                              { text: 'Data da Operação', datafield: 'DataOperacao', filtertype: 'date', width: 200, cellsalign: 'right', cellsformat: 'dd-MM-yyyy' },
                            ]
                        });

    WEBMETHOD

    <WebMethod()> _
        <ScriptMethod(UseHttpGet:=True, ResponseFormat:=ResponseFormat.Json)> _
        Public Shared Function VisitasAnteriores(ByVal gestor As String) As Object
    
            Dim visitas As List(Of VisitaAssistencia)
            Dim jsonSerz As New JavaScriptSerializer()
            Dim serializedData As String = String.Empty
    
            Try
    
                visitas = VisitaAssistencia.CarregaAssistencias(gestor)
    
                serializedData = jsonSerz.Serialize(visitas)
    
            Catch ex As Exception
                _logger.Error("Erro", ex)
            End Try
    
            Return New JavaScriptSerializer().DeserializeObject(serializedData)
    
        End Function

    ERROR


    Peter Stoev
    Keymaster

    Hi cfernandes,

    The process of passing parameters is illustrated in this help topic: http://www.jqwidgets.com/jquery-widgets-documentation/documentation/jqxgrid/jquery-grid-extra-http-variables.htm

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com


    cfernandes
    Participant

    Hi Peter,

    The example is not complete, I do not know where to put. Only i get error. Can you show me on my example where fit the parameters?

    Regards


    cfernandes
    Participant

    Hi Peter,

    Already lost my entire day reading all the topics that you recommend everyone to solve this problem.

    EX: http://www.jqwidgets.com/community/topic/jqx-dataadapter/

    Have you seen that you never helped anyone.

    Does anyone on this forum can help?

    Will have to look for other widgets?

    Does anyone have an example for this case?

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.