Skip to content
This repository has been archived by the owner on Sep 14, 2020. It is now read-only.

custom renderers #1

Closed
tijevlam opened this issue Jul 13, 2012 · 5 comments
Closed

custom renderers #1

tijevlam opened this issue Jul 13, 2012 · 5 comments
Assignees
Labels

Comments

@tijevlam
Copy link

Hello guys,

I love the new version of custom grids. I works great, but i found a problem.
Since i use it, im unable to assign a custom renderer for my own added column in the order grid.
Ive added an skus and names column, to display all items of my bundle and configurable orders.
But with custom grids i'm not getting my own custom renderer to display.
What to do?

best regards,

Tije

@mage-eag
Copy link
Collaborator

Hi Tije,

Thanks !
About your own custom renderer, is it one you added directly in the code of
the grid, or is it one based on the column renderers feature of the
extension ?
In any case, have you got some code that I could use to reproduce your
problem ?

Thanks,
Benoît

2012/7/13 tijevlam <
reply@reply.github.com

Hello guys,

I love the new version of custom grids. I works great, but i found a
problem.
Since i use it, im unable to assign a custom renderer for my own added
column in the order grid.
Ive added an skus and names column, to display all items of my bundle and
configurable orders.
But with custom grids i'm not getting my own custom renderer to display.
What to do?

best regards,

Tije


Reply to this email directly or view it on GitHub:
#1

@tijevlam
Copy link
Author

Hey Benoit!

Thanks for getting back on this. I actually solved it for now, allthough i dont know if it is the best (cleanest) solution.
I'm coding this in to the code directly. So nothing is edited in the extension.
I was trying to get this to work with multiple joins (one for each column).
I the end i solved this by using a zend_db_expr with if statements.

 $collection = Mage::getResourceModel($this->_getCollectionClass())
            ->join(
                'sales/order_item',
                '`sales/order_item`.order_id=`main_table`.entity_id',
                array(
                    'skus'                  => new Zend_Db_Expr('group_concat(`sales/order_item`.sku SEPARATOR ",")'),
                    //'configuratie'        => new Zend_Db_Expr('group_concat(`sales/order_item`.name SEPARATOR ",")'),
                    'leather'               => new Zend_Db_Expr('group_concat(IF( `sales/order_item`.product_id > "136" && `sales/order_item`.product_id < "223" ,`sales/order_item`.name, "") SEPARATOR " ")'),
                    'frame'                 => new Zend_Db_Expr('group_concat(IF( `sales/order_item`.product_id > "35" && `sales/order_item`.product_id < "42" ,`sales/order_item`.name, "") SEPARATOR " ")'),
                    'buttons'               => new Zend_Db_Expr('group_concat(IF( `sales/order_item`.product_id > "117" && `sales/order_item`.product_id < "123" ,`sales/order_item`.name, "") SEPARATOR " ")'),
                    'keypad'        => new Zend_Db_Expr('group_concat(IF( `sales/order_item`.product_id > "97" && `sales/order_item`.product_id < "116" ,`sales/order_item`.name, "") SEPARATOR " ")'),

                    )
                );
            $collection->getSelect()->group('entity_id');

@mage-eag
Copy link
Collaborator

Did you change anything regarding the renderer of your new column, to make it work, and then find what could be a compatibility problem brought by the new version ?
Or was the problem finally related to the orders collection and multiple joins (so then, not the extension) ?

Thanks,
Benoît

@tijevlam
Copy link
Author

In the end, the problem had nothing to do with your great extension. It
had everything to do with my orders collection and multiple joins. And the
fact that the custom render wasn't loaded is a conflict with another
(paid) extension: extended orders pro.

So your extension still works perfect. i did have another comment, would
it be possible to update the extension so you could edit the Inventory
column in the grid (products). Just you can (ajax)edit the name...

Thanks,

Tije

Did you change anything regarding the renderer of your new column, to make
it work, and then find what could be a compatibility problem brought by
the new version ?
Or was the problem finally related to the orders collection and multiple
joins (so then, not the extension) ?

Thanks,
Benoît


Reply to this email directly or view it on GitHub:
#1 (comment)

@mage-eag
Copy link
Collaborator

Thanks for the quick answer, and nice to hear that you could solve your problem (and that it was not due to a compatibility problem with the extension) ! I'll close the issue, but don't hesitate if you find other possible problems.

Concerning the inventory fields, they will soon be available as custom columns for the products grid, but not yet editable. The editability for the custom columns was (is) on my roadmap, but as it would require some refactoring on the two corresponding systems, it may take a while before I find enough time to work on it. Or at least, I'll have to choose between focusing on one big feature, that could open a new range of possibilities, or releasing new custom columns on a more regular basis. By the way, let me know if you have a preference :)

Best regards,
Benoît

@ghost ghost assigned mage-eag Aug 9, 2012
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants