Giter Club home page Giter Club logo

Comments (11)

vernmic avatar vernmic commented on June 3, 2024

Im not a php guy , i couldnt get the thing to load, I really was hoping to just use the html table conversion to bootstrap divs as a strictly jquery client side ui function and then wire the event callbacks to my own ajax calls back to a web api in .net.

anyway to strip the php so can take advantage of the neat ui as its own beast.

i tried to open the index.html from the download as a website in visual studios and add acouple of td rows to the sample table and remove the references to php action hoping it would just convert the static table to a openjs grid but it just gets stuck on loading cant figure out whats missing.

from openjs-grid.

optikalefx avatar optikalefx commented on June 3, 2024

The magic behind this grid is that it handles searching, sorting, paging and loading, as well as select drop downs all for you.

Yes you can use this grid without PHP but you need to handle all of the cases mentioned above. Those functions are not done in javascript because with LARGE data sets you can't let all the data load in.

If you didn't want to use the pager, you could just reconstruct the same JSON object that PHP creates.

from openjs-grid.

vernmic avatar vernmic commented on June 3, 2024

actually you can do the paging all client side and its very snappy.I routinely load 10k plus rows to the dom as an object array of rows. then take a page worth of those rows and append them to the table, then just swap out the visible rows using the page index and and pagesize. For filtering and sorting though yup agree all tables use ajax calls to resort and add filtering logic to the dataset. so those ajax methods for sorting and filtering i already have for my ugly tables.

that may be magic for the more front end oriented developers, but for me its the opposite, server side coding of web methods that will sort and filter a large dataset is easy peasy. returning the json object for the reformed table or even returning the rendered trs is no problem.

whats the magic for me is the nice looking javasript object with built in call backs and buttons and handles to wire right up to my already existing ajax methods, plus the columns with the types very handy. more difficult for me is making a nice looking ui with good looking shading and buttons and icons. that's the magic for us html and css inhibited developers.

If you could point me at a package or example that just has the grid populated from a javascript function that returns an json object that would be great. I wasn't able to figure it out from messing with the sample code.

class="users" action="ajax.php">
require_once("grid.php");

i'm not sure what 'ajax.php' or grid.php are supposed to return to replace it with some kind of method that returns some kind of object. or how ajax.php does the sorting or filtering.

does the ajax call for sorting do something like ajax.php?sortCol=col11&sortDir=asc

is there any way to build an empty grid with just the header row and then
do something like
grid.data = dataobject;
grid.reRender;

and grid.onSort = sortmethod

function sortmethod( column, direction)
{
return newsortedDataobjectfromajax(column, direction);
}
or
function sortmethod(grid, column, direction)
{
grid.data = newsortedDataobjectfromajax(column, direction);
grid.rerender();
}

i hope my my example thinking maps to your actual implementation in a way that makes some sense and you can give me some suggestions. Thanks.

note:
i'm not sure if your familiar with highcharts.com but that has a good example of a jquery ui tool that is independent of the back end server be it php , java or .net.

i think your solution maybe only one level of abstraction away from being just as independent or cross-platform compatible.

from openjs-grid.

udexon avatar udexon commented on June 3, 2024

I found the solution here:

http://www.trirand.com/jqgridwiki/doku.php?id=wiki:first_grid

The documentation is quite comprehensive except that it is not updated for the new CSS and js library versions -- might be a problem for beginners.

There are lots of examples on all sorts of Ajax data, from json to XML.

Highly recommended. I might write a longer article later on how I hacked the PHP example to eliminate MySQL -- which is quite straightforward really.

from openjs-grid.

udexon avatar udexon commented on June 3, 2024

Thanks a lot for all your comments and help, and great work!

Open source programming is more than just coding to me --- it is one of the few truly human endeavour left in the already broken and worsening society. . ... :-)

Happy programming!

from openjs-grid.

optikalefx avatar optikalefx commented on June 3, 2024

Did you use their docs to make my grid work? Or are you promoting their grid on this page?
It's easy to see the JSON object that prepares the grid, just watch your network ajax tab for the return of ajax.php

Ajax.php is the file that grid calls via ajax to do all of the work. That work includes loading, sorting, ordering and paging. The ajax file literally just sets up the options you want.

Grid.php is the mysql adapter file that takes what you wanted to do in ajax.php and actually does the database work. This file could be made into any language for any database.

Yes you could load 10k rows into memory and just show rows in the DOM that you need. But that wasn't the goal behind this. The goal was to have mysql do the work and grid be the UI.

But if you wanted implement the grid without mysql, just look at the ajax calls that get made and copy that object structure. The return isn't too complicated.

{
colData // don't worry about this for now
end // the ending page count
nRows // number of rows total
page // what page are you on
rows // an object keyed by _primary key. Yes _primary key to preserve order
saveable // an array of fields that are allowed to be saved, = fields that arent' from join tables
sort // sorting method
start //starting page
}

from openjs-grid.

udexon avatar udexon commented on June 3, 2024

Sean,

  1. Thanks a lot again for your advice.

  2. I am a lecturer in a university in Malaysia. I have no commercial interests whatsoever in jqgrid.

However, I am studying the nature of competition in open source programming, as a research topic.

As such, the following are my topics of interest, which I hope would be the same for you too:

a) Cross referencing of open source projects should help improve all parties concerned (owners and users (plural)).

Cross referencing is compulsory in academic publishing -- I hope this would could become a culture of the open source programming world too.

b) I like your style of programming -- bootstrap, root.js etc. These are your strength.

Perhaps jqgrid started earlier -- hence better documentation and more features. You and your team members could and should replicate those easily.

  1. Your code seemed to be coupled tightly to PHP -- I made some changes and it hanged.

  2. I saw your other news sorting project -- which is also my interest. I will explain more in the future and post it to my UDEX project group. Here is a quick intro of what UDEX is:

Catchy UDEX intro:

-- UDEX is THE next GMTF KILLER. No, GMTF stands for Google-Microsoft-Twitter-Facebook, not whatever acronyms you think it is related to ...

Alright, the above is just to get your attention. To sum up in one sentence, what is UDEX?

-- UDEX is a new way to implement a distributed database, that consist of ONE infinitely extensible table, with unlimited fields for each record.

Think MySQL -- UDEX is not constrained by the design and physical limits of conventional database systems.

You may think -- how is that possible? You will get your answers in the next few paragraphs, concisely!! .....

from openjs-grid.

udexon avatar udexon commented on June 3, 2024

Here is a more serious summary of the previous post:

  1. UDEX is my own implementation of this:

Kepner, Jeremy, et al. "D4M 2.0 schema: A general purpose high performance schema for the Accumulo database." High Performance Extreme Computing Conference (HPEC), 2013 IEEE. IEEE, 2013.

  1. One of the first UDEX application you might be interested to contribute and find useful is:

-- Cross website documentation updating: pooling posts from github, stackoverflow, etc. etc., private blogs for specific issues, e.g. HTML table.

from openjs-grid.

optikalefx avatar optikalefx commented on June 3, 2024

I'll be back in town on wednesday and can respond to these. In response to this line item

Perhaps jqgrid started earlier -- hence better documentation and more features. You and your team members could and should replicate those easily.

Specifically the word "easily". Writing documentation is very difficult. Self documentation tends to suck, and when you're a team of 1 with a full time job, building out documentation for a free open source project becomes time intensive. The docs you see on square-bracket.com/openjs took about 30 hours to write up. Deciding a format, detailing out properties, examples, etc all in a way that makes a lot of sense to both beginners and advanced users. Its not "hard" its just "time intensive"

At any rate, I have some thoughts on your project and I'll shoot those over when I get back. Thanks!

from openjs-grid.

udexon avatar udexon commented on June 3, 2024

Here's another application idea for UDEX, a very BIG one:

-- We can use UDEX for distributed web crawl -- let others set up UDEX server to do web crawl, build forward link tree -- even Google cannot afford to do this. Forward link tree -- the hyperlink structure to keep track of new web pages, posts or objects, referring back to the current node. This is tremendously useful -- updates, new jobs, etc. It is impossible to built without a distributed Non-RDBMS. No single company can have the resource to index the WHOLE Internet, with petabytes of new information every day!!!

UDEX will let users add missing info, such as author and date or other info of a web page.

Think of it like Twitter -- WITH structured search (exact matching of unlimited fields etc ....) The paper I cited above specifically conducted experiments using Twitter data.

from openjs-grid.

optikalefx avatar optikalefx commented on June 3, 2024

OK, let's get back to this thread. Apologies for being out on it so long.

I think your UDEX idea sounds pretty cool, would be interested to see it in action. Benchmarks against things like elastic search etc.

In terms of OpenJS Grid. we can work together to adapt the front end to be back end agnostic. It just has to implement a couple server side pieces. Or those can be turned off. You can see the data packet going back and forth by inspecting the network tab in chrome dev tools as you you use the grid.

In the coming months I'll have time to update the grid to the latest bootstrap. When I do that i'll investigate client side sorting.

from openjs-grid.

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.