Flutter is Amazing, and so is its widgets and extensive Documentation. I have an issue understanding a possible work around for an issue that is already filed in GitHub issues by many users, This Url will help you learn about the issue for Flutter's Dropdown Button and also the proposed work arounds. I am facing the same issue. There is a possible work around mentioned by Brian Egan in the link, however, I am not sure how to implement the same. I tried to comprehend the mentioned steps and achieve the desired result. However if I add an Expanded widget in my DropdownMenuItem, inside my DropdownButton Widget, it gives me an error for incorrect ParentWidget.
It would be great if someone illustrated the work around to me, anyone who can give me a better explanation.
Note: The issue is currently open, so its alright if we end up relying on the core team for this. But I believe there exists a simple work around here.
As requested in the comments, here is the sample code:
``` new DropdownButton(
value: value,
onChanged: (string) => setState(() => value = string),
items: Items.map((string) {
return new DropdownMenuItem(
child: new Text(string),
value: string,
);
}).toList(),```
Related
I am trying to get the flutter web app to append query param to the end of the url (when a selection is made in UI) without reloading the page
Basically I would like to update the URL from http://127.0.0.1:8080/#/sites to http://127.0.0.1:8080/#/sites?arg=1 without page reload
The following line (import 'dart:html') does not work in flutter (The URL does not change at all)
window.history.pushState(null, null, '?arg1=1');
I have also tried the js package (https://pub.dev/packages/js) and it does not work either.
Is there a way to get this to work in flutter web or are there any alternatives to achieve my requirement?
With a bit of struggle, and tried wrapping the call inside a Future.delayed seems to fix that issue.
Future.delayed(
Duration(milliseconds: 100), () => window.history.replaceState(null, null, '${Uri.base.toString()}?accountId=${selectedAccount.accountId}'));
If you have a better answer I would love to know. Thanks
Adding a PDF-Viewer tab to present/show a Sharepoint document has been working before.
I've tried this in January and it seemed to be an easy task - just get the DriveItem ID and URL (from GET /groups/{group-id}/drive/items/{item-id}) and edit the sample from the API Reference with these values (https://learn.microsoft.com/de-de/graph/teams-configuring-builtin-tabs#word-excel-powerpoint-and-pdf-tabs).
Now, that i want to use this, it doesn't work anymore ;-( The tab is created, added to channel, the name of the file shows BUT there is no document!!! What am i missing? Has the format changed? Has someone lately gotten this to work???
Please let me know, how! ;-)
ps: there is no description of the property "entityID" that makes any sense, can anyone explain it?
result in teams
Got the answer, was a Syntax problem!
The "contentURL" property needs to be unescaped (in this case the "%20"). It is that simple after all ;-)
Also i found out, the "entityID" property has no meaning for the File used. It can be "null" actually! I still use the ItemID i got from the DriveItem of the File.
For unescaping i used:
string contentUrl = Uri.UnescapeDataString(webUrl);
If it wasn't for this post I would have not gotten it figured out, so thank you!
For me I ended up having to make entityID null, just unescaping the contentURL didn't do it for me alone.
Thanks for your comment. leaving entityID null fixed my isse also.
I opend an issue to have the docs fixed!
I believe that I have found a bug in the new _super method of jQuery UI 1.9.x but wanted to run it by you guys first before I reported it. I figure it will be an easy vote for someone out there.
Here's the ticket that I was going to submit. It details the bug:
According to the documentation, _super() takes no arguments. However,
this doesn't work as expected when used in _setOption():
http://jsfiddle.net/grinn/8jKk8/1/
As you can see by clicking the Change Text button, the value of the
text option is not updated even though _super was called properly,
according to the docs at
http://api.jqueryui.com/jQuery.widget/#method-_super
But, if you pass key and value to _super, it does work properly:
http://jsfiddle.net/grinn/8jKk8/2/
I discovered this work-around by viewing the use of _super in the
jQuery UI code, itself.
I'm submitting this as a bug and not a documentation issue because it
would seem _super is expected to work as the documentation states.
Tested in Firefox 17, Chrome 23, and IE 9.
I decided not to report this issue. Judging from the fact that inside jQuery UI they use it as I've described below, I'm thinking that the documentation is just a little vague. For those of you experiencing this same issue, the correct way to use _super appears to be to pass through your arguments, like:
_setOption: function (key, value) {
// Your code goes here...
this._super(key, value);
}
...or more generically:
_setOption: function (key, value) {
// Your code goes here...
this._superApply(arguments);
}
I have a standard <select>..</select> element with which I have a slider created by selectToUISlider()
The problem is that when the slider moves the option in the dropdown does not change. Additionally it sets selected="selected" on each element as the slider is moved so that when the form is submitted multiple values are POSTed emulating a multiple select option.
I've spent ages trying to get to the bottom of this but no luck. Does anyone have any ideas?
I came across the same problem when trying to achieve similar functionality as mentioned by you.
The problem is whenever a slider is moved it keeps setting the "selected" attribute of the select list without clearing up previously selected item. I have added a script to clear previously selected option items before setting the new one as selected.
Look/search for the text at line number 92(..ish) of the jquery script file.
//control original select menu
var currSelect = jQuery('#' + thisHandle.attr('id').split('handle_')[1]);
currSelect.find('option').eq(ui.value).attr('selected', 'selected');
and insert this code between 2 lines...
currSelect.find('option[selected]').removeAttr('selected');
so final code should look like this...
//control original select menu
var currSelect = jQuery('#' + thisHandle.attr('id').split('handle_')[1]);
currSelect.find('option[selected]').removeAttr('selected');
currSelect.find('option').eq(ui.value).attr('selected', 'selected');
I hope it helps.
Feel free to ask any further question.
I know this is quite old but I recently stuggled with this and maybe my solution helps someone. I had this same problem when using more recent versions of jQuery (>jQuery 1.6.1) and JQueryUI and trying to use selectToUISlider with them.
I found my solution (using properties insted of attributes) just replacing in the selectToUISlider.js script, in line 98
This
currSelect.find('option').eq(ui.value).attr('selected', 'selected');
for this
currSelect.find('option').eq(ui.value).prop('selected', true);
You can find the "Why" on this answer, which helped me to find this solution:
https://stackoverflow.com/a/5876747/2285806
You can read also the jQuery API entry for prop() to find more information and read important notes on browser backwards compatibility:
http://api.jquery.com/prop/
I'm working on a site in Symfony that displays graphs of a range of metrics.
Currently I'm trying to implement a simple datepicker to decide what graph to show.
Preferably in one of these forms:
a simple calendar icon that presents a calendar when clicked
three drop-downs for the day, month and year
The latter only as a plan-b really, the first would be great.
Now, I'm new to Symfony and I'm quite spoiled. Everything I wanted so far has always been but a plugin/helper/tag away. I sort of hoped that it was the same for a date-picker like this one, but so far I'm coming up empty. There are a few possibilities, but they all require a crap-load of dependencies and seem to have a low success-rate with people who have tried to implement them.
I have the feeling that I'm overlooking something that's right in front of me.
So in short: what is, according to you guys, the simplest way to implement such a date picker in Symfony? And if you have one, do you have a link with a clean and clear explanation?
Thanks a bunch,
Dieter
I use sfWidgetFormJQueryDate widgets based on jquery-ui from sfFormExtraPlugin.
class YourFormFilter extends BaseYourFormFilter
{
public function configure()
{
$date_widget = new sfWidgetFormJQueryDate(array(
'date_widget' => new sfWidgetFormDate(array('format' => '%day%/%month%/%year%')),
'culture' => 'ru'
));
}
}
Check this one, it is intended for Syfmony2
http://blog.azancadas.com/2011/07/symfony2-datepicker/