OlegK

Forum Replies Created

Viewing 15 replies - 826 through 840 (of 968 total)
  • Author
    Replies
  • in reply to: Pager not working (for me). Where am I doing wrong? #95687
    OlegK
    Participant

    In general the less data you send over the wire the better. So instead of array of strings like

    {“ID”:1,”Sigla”:”AG”,”Name”:”Agrigento”,”Region”:”Sicilia”}

    which are elements of rows array and every row represent an object jqGridRecord. It can be better

    [1,”AG”,”Agrigento”,”Sicilia”]

    as representation of List or string[]. Then you can use more simple jsonReader (without repeatitems: false). It seems to me you can easy implement such data representation. A discussion about this and the coresponding example you can find here

    http://stackoverflow.com/questions/3054463/jqgrid-3-7-does-not-show-rows-in-internet-explorer/3061669#3061669

    Best regards
    Oleg

    in reply to: Pager not working (for me). Where am I doing wrong? #95672
    OlegK
    Participant

    OK. Now I understand where you have the problem. You use Newtonsoft.Json to serialize the data, but your web service don't know this and try to serialize the data one more time. So you have probably twice serialized string. If the oririnal string was My string. JSON seirialized string will be My string“. If the original string was “MyString” then serialized version will have escaped quotas: “MyString”. So after deserialization of a string you have allways the type string in Javascript instead of an object.

    If you will just use standard Microsoft serialization you need only include

    [WebMethod, ScriptMethod(ResponseFormat = ResponseFormat.Json)]

    before the web method GetProvinces and return just an instance of the class JqGridData. Web service will serialize the data yourself, but include all data inside the property “d”: {d:{..}}.

    I uploaded a working test program which full simulate your first data under http://www.ok-soft-gmbh.com/jqGrid/WebServicesPostToJqGrid.zip.

    If you do need to use a custon JSON serialization like Newtonsoft.Json I should better use WCF instead of ASMX. The code is exactly so simple like ASMX, but you have much more flefibility. If your WCF web method return Stream or Message type, than you can return any type of data: any custom serialized JSON data, JPEG and so on. You can also stream the data if needed.

    See http://msdn.microsoft.com/en-us/library/ms789010.aspx, http://stackoverflow.com/questions/3078397/returning-raw-json-string-in-wcf/3079326#3079326 and http://stackoverflow.com/questions/3118504/how-to-set-json-net-as-the-default-serializer-for-wcf-rest-service/3131413#3131413 for more information.

    Regards
    Oleg

    in reply to: Pager not working (for me). Where am I doing wrong? #95670
    OlegK
    Participant

    I am sure, that your problem is on the server side. If I save the JSON data which you posted to a file verorange.txt, change mtype: “POST” to mtype: “GET” one can test the grid without any active server components. How you can see here

    in reply to: Pager not working (for me). Where am I doing wrong? #95665
    OlegK
    Participant

    OK I agree, that as I read till the end your post I forgot how you start the mail. So I forgot that you are beginner in jqGrid. Moreover it was 3:00 at night.

    If your server really produce the JSON data like you wrote before you should change declaration of jsonReader to

    in reply to: Pager not working (for me). Where am I doing wrong? #95661
    OlegK
    Participant

    I don't like if sombody be not polite to me. Jokes like “You should ask somewhere else if you want help…” I find not funny.

    Your code not works because it has errors (at least 2). Good luck in searching of errors. Bye bye.

    Oleg

    OlegK
    Participant

    You should include i18n/grid.locale-en.js before laoding jquery.jqGrid.min.js. See /jqgridwiki/doku.php?id=wiki:first_grid#html_file

    You should of cause download from http://www.trirand.com/blog/?page_id=6

    in reply to: source files not executing before my code #95654
    OlegK
    Participant

    You can insert in your page all javascript files which you need to load (look inside of grid.loader.js) exactly how you load grid.loader.js file.

    in reply to: Pager not working (for me). Where am I doing wrong? #95653
    OlegK
    Participant

    I don't understand why you use datatype as function to load JSON data? jqGrid has already support for JSON data. You should just use datatype: “json”

    in reply to: showlink target option does not work #95649
    OlegK
    Participant

    Hi!

    I use 'showlink'

    in reply to: jqgrid filtering #95646
    OlegK
    Participant

    I don't use Spring Framework myself, so I could not help you with any Spring MVC 3.0 examples. Some general solution is more common. For example in ASP.NET MVC solutions I

    in reply to: jqgrid filtering #95643
    OlegK
    Participant

    Hello!

    The answer on your question depends a little how you interpret the “filtering”. If you want use some external controls (selects, checkboxes and so on on the same page where you have jqGrid) to filter your data I recommend you to read http://stackoverflow.com/questions/2928371/how-to-filter-the-jqgrid-data-not-using-the-built-in-search-filter-box/2928819#2928819

    If you want to implement data filtering inside of jqGrid you can choose between serching with respect of “search” and reset of serching results with respect of “refresh” buttons of the /jqgridwiki/doku.php?id=wiki:navigator) action which provide the grid data or add three string parameters searchField, searchString, searchOper if you want to use simple searching feature. In all cases you will have to add WHERE to the SELECT statments which will be constructed in your program based on the values of the new parameters.

    Probably other people post you more urls to the good full code examples which you could use.

    Best regards
    Oleg

    in reply to: Data load preprocessor #95642
    OlegK
    Participant

    Do you tried with dataFilter event of jQuery.ajax? You can set it with respect of ajaxGridOptions option. In general I could agree with you that

    in reply to: field search box #95633
    OlegK
    Participant

    You can define search: false for any column in the colModel (see /jqgridwiki/doku.php?id=wiki:colmodel_options). This will disables searching on that column. In general it seems me that columns with hidden: true, will not be displayed in the searching dialog if you

    in reply to: Jsonstring with self-defined “records” or “total” #95613
    OlegK
    Participant

    Hi Taker!

    The datatype “jsonstring” is a form of holding of the local data in jqGrid where you load all the data in once. So having the number of records or the number of pages which not corresponds the data from the JSON string has no

    in reply to: how to capture column order #95521
    OlegK
    Participant

    Hi Mark!

    It seems to my Tony misunderstood your question. I hope if you define sortable parameter as an object instead of a boolean you can solve your problem. For example

    sortable: {

Viewing 15 replies - 826 through 840 (of 968 total)

Stay connected with us in your favorite flavor!