Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

All other Modules /

Discuss all other Modules here.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

New Module : Create custom LeftAndMains with PanelModelAdmin


Go to End


10 Posts   5736 Views

Avatar
Martijn

Community Member, 271 Posts

29 September 2010 at 4:09pm

Edited: 29/09/2010 4:09pm

I created a module which extends the possibilities of ModelAdmin, in order to be able to create custom LeftAndMains without extending LeftAndMain directly, but to use the power of ModelAdmin.

Some Silverstripers already knows this from the Google dev list and the IRC channel and I think it can be usefull for a wider audience.

PanelModelAdmin allows a flexible manner to devide the left sidebar in seperate searchpanels, menulists or custom panels which all can have their own managed DataObjects. In this way you have more flexibility to organize your DataObject management.

See this slideshare for how it looks and what it can do:

http://www.slideshare.net/marvanni/panelmodeladmin-example

Features:

Create custom panels for the sidebar
Create custom (nested) menulists (with parent => child relations)
Create custom panels to show whatever you want (plain content, rss etc.)

Use TableListField, TableField or ComplexTableField for the ResultsField (DOM support is in progress).
Show a default ResultsForm on the initial view of the admin panel.
Show custom content, instead of a ResultsTable ( you can use this to show for example a Calendar, Dashboard or whatever you put in your DataObject).

Obeys canView, canEdit, canDelete and canCreate on each record instead of only the complete set (i.e. hide rows that authors are not allowed to see, or limit the amount of records they can create).

There are still some little refinements to do, but on a custom NewsLetter and Webshop module it works solid.

You can checkout the module from svn on:

http://svn.axyrmedia.com/panelmodeladmin/trunk/

A sample implementation can be found on:

http://svn.axyrmedia.com/productadmin/trunk/

Or download attached files

I would like to know what you think of it and if you have any improvements let me know!

Attached Files
Avatar
swaiba

Forum Moderator, 1899 Posts

29 September 2010 at 10:33pm

this is very nice, thanks Martijn

Avatar
CoconutDrink

Community Member, 16 Posts

2 October 2010 at 2:27am

HI Martijin,
Can u attach the ppt, it looks very interesting.

Avatar
frankmullenger

Forum Moderator, 53 Posts

5 October 2010 at 4:59pm

I've come across this module after hacking about trying to extend LeftAndMain and ModelAdmin, thanks heaps Martijn!

Avatar
Martijn

Community Member, 271 Posts

5 October 2010 at 8:19pm

Edited: 05/10/2010 8:21pm

@CoconutDrink : Can't you see the slideshare ? Anyway, see attached file.

@frankmullenger : Thanks. Hope it is useful!

Attached Files
Avatar
frankmullenger

Forum Moderator, 53 Posts

11 November 2010 at 4:08pm

Hey Martijn, regarding that known issue of: Sometimes the wrong buttons are displayed in the ResultsForm and EditForm.

I'm finding that after an AJAX request has been processed, such as clicking to view the next 10 results of objects, if I click to edit an object the save, delete and back buttons are hidden - by some javascript I think.

When I click to edit a record in the first 10 results without clicking to view the next 10 results or triggering an AJAX call like that, the buttons display correctly. I couldn't easily find where the buttons were being hidden, hope that helps though.

Avatar
MarcusDalgren

Community Member, 288 Posts

19 November 2010 at 2:25am

Just trying this out. I'm using both the panelmodeladmin and the productadmin running on the latest branches/2.4. When trying to add a new customer I get this error.

ERROR [User Error]: Couldn't run query: 
SELECT "OrderItem"."ClassName", "OrderItem"."Created", "OrderItem"."LastEdited", "OrderItem"."Title", "OrderItem"."ProductID", "OrderItem"."ID", CASE WHEN "OrderItem"."ClassName" IS NOT NULL THEN "OrderItem"."ClassName" ELSE 'OrderItem' END AS "RecordClassName"
FROM "OrderItem"
WHERE ("ParentID" = 2)
LIMIT 10 OFFSET 0 

Unknown column 'ParentID' in 'where clause'

Avatar
Martijn

Community Member, 271 Posts

20 November 2010 at 1:22am

@frankmullenger, @Smurkas :I will take a look at it next week!

Go to Top