EllisLab text mark
Advanced Search
     
DMZ: HTML Table extension (contributed). DMZ 1.7+
Posted: 22 March 2010 05:44 AM   [ Ignore ]
Joined: 2009-03-21
34 posts

(Now with _iterated support)

ATTENTION: this extension is third-party, so don’t bother Phill with questions about it.

Features are:

- well documented

- label from $validation / custom label
- mapping by $validation[‘field’][‘values’] / custom array mapping
- custom callback-generated fields

- autopagination with native CI paginator when _paged

- table elements attributes assigned automaticaly

This extension works in the similar way as original HTML Form extension.

All it does is provide render_table() method that builds html code based on settings given by user. It can save some time for you and make table-generation part of the view more readable. Extension is shipped with two table templates: object_per_row and object_per_column.

Docs are included in Distrib.

Installation: To make HTML Table available, copy application folder’s content from distrib into your application folder.

WARNING!
If you have your own MY_html_helper, be careful not to rewrite it with same file from this distrib, just append your own with it’s content.

MY_html_helper contains one single function wrap() that makes output of optional parts of page more convinient. It’s used in table templates.

 Signature 

HTML Table extension for Datamapper Overzealous

 
Posted: 05 April 2010 01:26 AM   [ Ignore ]   [ # 1 ]   [ Rating: 0 ]
Joined: 2009-09-25
9 posts

Gosh! I just finished a DMZ extension based on nearly the same idea. I named my extension as htmllist.

 
Posted: 05 April 2010 11:15 AM   [ Ignore ]   [ # 2 ]   [ Rating: 0 ]
Joined: 2009-03-21
34 posts

Yeah. Actually it was very strange that noone had posted such an obvious ext for so long time.
Now i’m finishing docs for an upgraded version.

May i look at yours? )) Maybe we can work together or smth )

 Signature 

HTML Table extension for Datamapper Overzealous

 
Posted: 23 July 2010 02:54 PM   [ Ignore ]   [ # 3 ]   [ Rating: 0 ]
Joined: 2008-01-04
300 posts

Nice extension! Thanks!

I’m having some problems with toString and getting it to return the name of the relationship.

Accounts and Groups have a field called “name”, so in my models I have this:

public function __toString()
    
{
        
return $this->name;
    

However when executed, this error is returned

MessageMethod Group::__toString() must return a string value 

Same with Account.

And I am making sure I am included the related accounts and groups

$users->include_related('group', array('name'));
        
$users->include_related('account', array('name')); 

Any ideas?

 
Posted: 24 July 2010 03:15 AM   [ Ignore ]   [ # 4 ]   [ Rating: 0 ]
Joined: 2009-03-21
34 posts

By executed do you mean you call ->render_table() ?

Please post here code snippet causing error.

 Signature 

HTML Table extension for Datamapper Overzealous

 
Posted: 24 July 2010 06:16 AM   [ Ignore ]   [ # 5 ]   [ Rating: 0 ]
Joined: 2008-01-04
300 posts

This is the code.

$users = new User();
        
$users->include_related('group', array('name'));
        
$users->include_related('account', array('name'));
        
$users->get_paged_iterated($offset20TRUE);
        
        
$scheme = array
        (
                
'name',
                
'email',
                
'group',
                
'account',
                
'func_delete_link' => 'Delete',
                
'func_edit_link' => 'Edit'
        
);
        
        
$opts['caption''Users';
        
$opts['pagin_conf']['base_url'site_url('users/all/');
        
        
$view_data['table'$users->render_table($scheme$opts); 
 
Posted: 24 July 2010 07:54 AM   [ Ignore ]   [ # 6 ]   [ Rating: 0 ]
Joined: 2009-03-21
34 posts

Looks like you include related fields without instantiation, (read include_related docs) so when render_table() tries to access
$users->group group has no “name” property and it’s set to null or smth.

So your $scheme should containt something like
...
‘group_name’ => ‘Group’
‘account_name’ => ‘Account’
...

 Signature 

HTML Table extension for Datamapper Overzealous

 
Posted: 24 July 2010 07:59 AM   [ Ignore ]   [ # 7 ]   [ Rating: 0 ]
Joined: 2008-01-04
300 posts

Ah I see! I’ll try that - thanks.

 
Posted: 26 July 2010 11:15 AM   [ Ignore ]   [ # 8 ]   [ Rating: 0 ]
Joined: 2010-07-26
2 posts

thanks for share

 
Posted: 27 July 2010 01:37 AM   [ Ignore ]   [ # 9 ]   [ Rating: 0 ]
Joined: 2009-03-21
34 posts

Thanks for response ) Really nice to hear

 Signature 

HTML Table extension for Datamapper Overzealous

 
Posted: 09 October 2010 10:47 PM   [ Ignore ]   [ # 10 ]   [ Rating: 0 ]
Joined: 2009-03-21
34 posts

8)) ^_^

 Signature 

HTML Table extension for Datamapper Overzealous