Git Product home page Git Product logo

Comments (12)

tabalinas avatar tabalinas commented on July 21, 2024

Thank you for the feedback!
Your config looks well at first sight.

Try to change loadData method like following to be sure that ajax call returns the same data (see in console):

loadData : function(filter) {
    var d = $.Deferred();

    filter["operation"] = "loadUrls";

    $.ajax({
        type : "GET",
        url : "ruleenginehandler",
        data : filter,
        dataType : "json"
    }).done(function(result) {
        console.log(result);
        d.resolve(result);
    });

    return d.promise();
},

Actually, there should be no difference between static data and data returned by loadData.

from jsgrid.

aarangara avatar aarangara commented on July 21, 2024

I tried what you suggested for load method. The console outputs the following :

[Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object]

I guess there are the objects that contain the data returned by my serer side code.

Is there any issue with this?

I will explain what I have done in my server side code for returning json array :

I have a pojo class which I convert to a json string using Gson. and then just return that same string as response. Is there something wrong I am doing in my server side code?

from jsgrid.

fanturi avatar fanturi commented on July 21, 2024

Hi,

If you want to see what your object contains change: console.log(result) by console.dir(result).
If I checked correctly your code your object must have at least this fields: userId, url, enable and timestamp. If not adapt your server code.

from jsgrid.

aarangara avatar aarangara commented on July 21, 2024

I tried using

console.dir(result).

It gives me following :

grid-demo

It is having all required params as mentioned by you. I don't understand what am I missing though.

from jsgrid.

fanturi avatar fanturi commented on July 21, 2024

I don't understand your part with the filter and your way to load data
Have you tried a more classic way to load your data ?
For example:

$.ajax({
    url: "your/path",
    type: 'GET',
    dataType: 'json',
    data: {
        method: "your-method",
        userId_filter: filter.userId,
        url_filter: filter.url,
        enable_filter: filter.enable,
        timestamp_filter: filter.timestamp
    }
}).done(function(response) {
    d.resolve(response);
}).error(function(jqXHR) {
    d.reject(jqXHR.status);
});

return d.promise();

from jsgrid.

aarangara avatar aarangara commented on July 21, 2024

Yes, I tried this, but this is also not working for me. Only loads first row data on each page.

My loadData method is called when page loads up first time as I have set autoLoad as true.

This my java code for loading data, if it helps :

List<ITCTable> data = dbManager.getAllUrls();
Gson gson = new Gson();
JSONArray jsonData = new JSONArray(gson.toJson(data));
System.out.println(data.size());
System.out.println(jsonData);
writer.write(jsonData.toString());

from jsgrid.

fanturi avatar fanturi commented on July 21, 2024

I don't know why sorry.
Just to be sure have you check the others objects in your result.
In your screenshot we can see the first object only.

from jsgrid.

aarangara avatar aarangara commented on July 21, 2024

Yes I checked each of 31 objects returned in my result and everything looks fine.

Please someone help me out with my problem, as I found this plug-in as the easiest for usage and understanding.

from jsgrid.

fanturi avatar fanturi commented on July 21, 2024

the only difference I see between your result and your static data is with the field enable.
You are using true/false with ajax and 1/0 in the static data.
and personally I have some problems with field name like "enable" or common name like this.

sorry not to be able to help you, I hope @tabalinas can.

from jsgrid.

aarangara avatar aarangara commented on July 21, 2024

I changed my server side code to return 0/1 instead of true/false, but still no luck.

@fanturi Thanks for your help and efforts.

UPDATE :
When I removed the CSS, it shows me all data with proper paging. Is there something wrong with the css (jsgrid.min.css)?

from jsgrid.

aarangara avatar aarangara commented on July 21, 2024

Finally my problem is resolved.

I kept the height as 100% in my config which is why the data was not getting displayed below the first row.

I really apologize for this as I don't have much experience with UI.

from jsgrid.

tabalinas avatar tabalinas commented on July 21, 2024

Glad that you figured this out!

from jsgrid.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.