Welcome Guest, Not a member yet? Register   Sign In
Ignited DataTables
#41

[eluser]saimaz[/eluser]
hi, here is my category model
Code:
<?php

class Category extends Doctrine_Record {

    public function setTableDefinition() {
        $this->hasColumn('name', 'string', 255);
        $this->hasColumn('link', 'string', 255);
    }

    public function setUp() {
        $options = array(
            'hasManyRoots' => false,
            'rootColumnName' => 'root_id'
        );

        $this->setTableName(TABLE_PREFIX . 'category'); //here i don't know how to
           //set up table prefix global to doctrine, so i use constant.

        $this->actAs('Timestampable');
        $this->actAs('NestedSet'); // its for hierarchical structure

        $this->hasMutator('name', '__create_link');


        $this->hasMany('Item as Items', array(
            'local' => 'id',
            'foreign' => 'category_id'
        ));
        $this->hasMany('Filter as Filters', array(
            'local' => 'id',
            'foreign' => 'category_id'
        ));
        $this->hasMany('Classification as Classifications', array(
            'local' => 'id',
            'foreign' => 'category_id'
        ));
    }
}
#42

[eluser]cryogenix[/eluser]
[quote author="Si Jampank" date="1291843738"]i mean how can this library using for CRUD application?in that libraries i found how it can add addtional column for delete or update. But how can i use it?anyone help me.. so many thanks[/quote]

if you browsed through the code in the library, at around line 214, you'll see something like this:

Code:
/*
  add additional columns here
  like adding a Delete Row control for example:

  $aaData[$row_key][] = '<a href="#">Delete Button</a>';
*/

mmmkaye?
#43

[eluser]HiTek[/eluser]
Hello,
thank you for the excellent library. It helped me a lot.
Here is adapted for work with PostgreSQL library. Also I did this improvements:
- added here two "virtual" methods produce_cell and produce_row to allow descendands to manipulate cell values and completed rows.
- added additional constructor parameter $hiddenColumns. This columns aren't shown in the result output but you may access theirs values to compute something.
- The library handles SQL like 'field1 as f1' in ordering and filtering.

File is too big for the post and I attached it as zip file.
#44

[eluser]Gizmo84[/eluser]
Hi,

Just began playing with DataTables and this tutorial was great except I cannot have a table with more than 4 columns. I have a table with 9 columns and I get the following error via [removed]

DataTables warning (table id = 'drivers'): Added data (size 9) does not match known number of columns (4)

I checked via firebug and the POST has (iColumns 4) as one of the parameters. I figured this was done dynamically with an array count of the columns you pass to the library but obviously not. I have searched all over the application looking for where this has been set to (4) or if there is a bug stopping the count to work.

Hoping someone could shed some light on the problem

Thanks in advance.
#45

[eluser]HiTek[/eluser]
Take a look in JS-code where you create DataTable. Please, notice the parameter "aoColumns".
#46

[eluser]Gizmo84[/eluser]
Hey thanks for the quick reply,

Yeah I have tried that, but all the JS looks fine it is doing a count for the aoColumns to create the iColumns param. I was hoping someone had a similar problem with this library to help narrow it down.

Cheers
#47

[eluser]HiTek[/eluser]
Have you tried to remove the parameter? I'm 90% sure the problem is somewhere in JS.
#48

[eluser]Gizmo84[/eluser]
I don't think its a JS problem, I changed to the most up to date version of DataTables JS and still nothing, all the information is being passed to the view but DataTables can't show it based on this column count.

If I change the AJAX type from post to get I don't get the error but it still does not show the data, in both post and get the response has all the data! I don't know if the php isn't passing the right column count properly!
#49

[eluser]HiTek[/eluser]
I see. It's hard to say what is wrong without the code.
#50

[eluser]Gizmo84[/eluser]
ok i'll send my code. Quick question how to I wrap my code in a post?




Theme © iAndrew 2016 - Forum software by © MyBB