Giter Club home page Giter Club logo

datatables's People

Contributors

asb-capfan avatar manwar avatar srchulo avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

datatables's Issues

Add Travis CI

Could you maybe set up Travis CI for this repository? It's really simple (just create an account and add a .travis.yml file) and it gives you automated tests for pull requests. Cf. https://travis-ci.org

Whishlist: improve how patterns work

Similar to the DataTables editor library, DataTables could offer a generic hook where arbitrary post-processing could be done.

Also, maybe add to the docs more clearly how patterns work and that it is result post-processing. Maybe add a sample script (have one) or a test showing the feature.

Please create a new CPAN release

Could you please release a new version of DataTables to CPAN to publish the changes?

I would be happy to do co-maint for the module on CPAN if you like, so I could push new releases, too.

response data is only able to answer with column numbers, not with column names

Currenty, a JSON response looks like this:

{
	"aaData":[
		[25,"Misc","NetFront 3.4","Embedded devices","-","A"]
	],
	"recordsFiltered":1,
	"recordsTotal":57,
	"draw":27
}

The fields are represented by array index. Column 0 holds the ID with value 25 in the example above.
It's not yet possible to get a mnemonic answer like this:

{
	"data": [
		{
			"id": 25,
			"engine": "Tiger",
			"browser": "Nixon",
			"platform": "System Architect",
			"version": "[email protected]",
			"grade": "Edinburgh"
		}
	],
	"recordsFiltered":1,
	"recordsTotal":57,
	"draw":27
}

What was the motivation to use index columns?

The module uses index_cols to count the number of results (not sure however if it is done correctly).
Why did you use the index_cols? I ask because SELECT COUNT(*) does the same without the knowledge about index_cols.

Add query as argument (at least to new)

I would like to add a possibility to re-use an existing query. Mainly, to make testing easier. This way, one can simply provide a query object with a param method, that will be accessed by the module.

There is multiple approaches:

  • add a param to new
  • add a new attribute, like dbh
  • create an accessor method similar to cgiapp_get_query of CGI::Application that can be overridden

Not sure if it could be useful for anything other than testing.

Would it be ok to add this feature and which possibility do you prefer?

Don't force to use mysql, don't reinvent the DBI wheel :)

In the current code, mysql is hardcoded. Why not just have the user provide a database handle and use a library like SQL::Abstract to build the queries?
This way, the module can be used with (for example) SQLite as well.
If it's OK for you, I can submit a pull request.

replace CGI by CGI::Simple

As CGI is only used to access query parameters, a more lightweight module like CGI::Simple would be sufficient, too.
In addition, CGI has been removed from the core, so it doesn't matter if CGI or CGI::Simple has to be installed as dependency.
If you like the idea, I can submit a pull request.

Invalid response data when search request returns empty search result

Using DataTables 1.10, I get an error "TypeError: data is undefined" when a search in the table data returns an empty result.
For example, response data looks like this: {"recordsTotal":57,"recordsFiltered":0,"aaData":"","draw":19}

Note that I assume that aaData should be data anyways.

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.