7912 Posts in 1355 Topics by 930 members
DataObjectManager Module
SilverStripe Forums » DataObjectManager Module » Feature Requests
Discuss the DataObjectManager module, and the related ImageGallery module.
Moderators: martimiz, UncleCheese, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
| Go to End | Next > | |
| Author | Topic: | 10919 Views |
-
Feature Requests

21 May 2009 at 2:56am Last edited: 21 May 2009 2:56am
Please post any feature requests for here. My hope is to use the RSS feed of this thread as a punchlist when I have time to put into developing new features for DataObjectManager or ImageGallery.
-
Re: Feature Requests

27 June 2009 at 1:56am
It would be absolutely lovely if the DatePickerField could be used in the regular CMS as well, not just the popup window. I tried using it instead of the regular calendar field but the calendar didn't show up when I clicked in the field. It worked when I used it in a popup when I tried out your Testimonial examples.
Kindly, Marcus
-
Re: Feature Requests

28 June 2009 at 1:01am Last edited: 28 June 2009 1:02am
Ok I have fixed it (kind of). There seems to be two issues, the first one is a CSS issue. Simply add in #ui-datepicker-div { z-index: 999;} to make sure that the datepicker lands itself on top of everything else.
The second issue seems alot weirder. If I navigate from one page type in the CMS that doesn't have the datepicker field to a page that does then the datepicker won't function. However if I reload the page while on the page with the datepicker field then the datepicker will work the way it should.
I have no idea why this is. I modified the datepicker code to
'(function($) {
$(function(){
$("#'.$id.'").datepicker({dateFormat : "'.self::$dateFormat.'"
, buttonImage : "/sapphire/images/calendar-icon.gif"
, buttonImageOnly : true
});
});
})(jQuery);'It seems to need document ready when used as a regular field in the CMS, I tried running it with your old code and got an error on the field being null.
-
Re: Feature Requests

28 June 2009 at 1:37am Last edited: 28 June 2009 2:59am
Ok I wasn't thinking big enough on my event delegation. If you run the rather silly
'(function($) {
$(function(){
$("body").mouseover(function(event) {
var target = event.target;
if (target.id == "'.$id.'") {
$(target).datepicker({dateFormat : "'.self::$dateFormat.'"
, buttonImage : "/sapphire/images/calendar-icon.gif"
, buttonImageOnly : true
});
}
});
});
})(jQuery);'
it works.Now if you'll excuse me I'll have go and pretend I never wrote that.
Oh and if you go from a Testimonial page to the regular cms page with the datepicker on, the styles don't work. I think the issue is related to the fact that we get two datepicker divs with the same id on the page and jQuery gets confused.
Ok I fixed that by switching DataObjectManager to jquery ui 1.6 instead of 1.5.3. After putting both the field and the DataObjectManager on the same version of jQuery ui they play nice.
There is one last issue which seems to be related to the fact that as far as I can tell, the javascript for the DatePickerField is not loaded properly unless I do a reload on a page which has the datepickerfield on it. It works for the popup but we need to find a way to register the scripts even though the field isn't actually on the first page we visit in the CMS.
-
Re: Feature Requests

28 June 2009 at 4:10am
Oh, I see. Right, so we'll have to apply the event using the Behaviour class. That sounds easy enough. I'll give it a try.
-
Re: Feature Requests

28 June 2009 at 5:01am
Ok so I managed to get scripts registered globally through Object::extend() by looking at how you did it in verticaltabs.
So I wrote something like this
<?php
class DatePickerFieldScriptInit extends Extension {
public function augmentInit() {
Requirements::javascript("jsparty/jquery/jquery.js");Requirements::javascript("dataobject_manager/javascript/jquery-ui.1.6.js");
Requirements::javascript("dataobject_manager/code/date_picker_field/datepicker.js");Requirements::css("dataobject_manager/css/ui/ui.core.css");
Requirements::css("dataobject_manager/css/ui/ui.datepicker.css");
Requirements::css("dataobject_manager/css/ui/ui.theme.css");
}
}
?>And this gets the scripts registered on all pages. However what do we do about the custom script that references internal properties of the DatePickerField? Is there some other way of getting scripts on the global queue?
-
Re: Feature Requests

8 July 2009 at 8:49am Last edited: 8 July 2009 8:50am
You can now set a default value to your filter using the optional fourth argument of the setFilter() function
$manager->setFilter(
'MyField',
'MyLabel',
array('Value1' => 'Label1', 'Value2' => 'Label2'),
'Value2'
)';Sets a default filter of "Value2"
-
Re: Feature Requests

14 July 2009 at 4:20am
You can have more control over your thumbnails by toggling the "square thumbnails" boolean.
| 10919 Views | ||
| Go to Top | Next > |

