First of all, my english skills fell apart during the last years so I hope I can explain my problems exactly.
Im trying to write a garbage calendar app with an alarm, notification and so on if it might be ready some time.
At first you have to choose the right address of your city and due to that I know in which district the user is living and with that information I know when his garbage is being collected.
Right now I have two problems and I really can't fix them.
The first one is when I chose my address I'm coming to the address site where the address is shown and I have two buttons. The first one is: "Wrong address?" and the second one is "show me the dates for this district".
When I'm clicking the second option with the dates I'm calling my function doSomething3(sorry for those names) but if I'm coming to the page where the dates should be shown there is nothing shown on this page.
I figured out when im setting the variable viewModel.bezirksnr in the javascript file and for example navigate from the homescreen to the dates of districts with opening the same function its actualy workin so i guess my function isn't completly wrong.
The second observation I made is when I'm setting the variable, then pushing the button in the homescreen for showing me the dates (is working ofc) and then I'm setting an address and then push the button from my address site to show me the dates then something like this appears:
Every single date of the first attempt(with the variable set before starting the app) is followed by all of the dates of the new chosen district.
The second problem is the performance problems. When I selected an address and maybe I miss clicked and want to select another its not working. The app is so laggy and doesn't react anymore.
Due to this and cause of the pic I uploaded I guess maybe I'm not clearing the arrays in a right way but I tried for example the removeAll() for observable arrays but there was no effect.
Here is my index.html including all those pages:
http://pastebin.com/Zci009cn
And here is my javascript file:
http://pastebin.com/PwBdkBa0
I put them into pastebin for not creating a massive wall of text ;)
I hopefully could explain everything in an understanding way and it would be awesome if anyone can help me! if you have any questions, feel free to ask
Related
A working model that replicates the problem, described in the title, is here:
https://codesandbox.io/s/workingreactgrid-zvz12
In the program, the first thing to do is to enter any arbitrary date in the Date of Sale datepicker (under 'Exit Price' on the left). This creates a table that will appear below the inputs. Now the problem I am running into is that when I enter any number for "Rents - Monthly" or for any of the other expenses, e.g. Repairs & Maintenance, Insurance, etc., the numbers will only appear in the table after I manually click on the table.
My research suggests that I am probably doing something wrong with my useEffect in the App component. My hypothesis is that the table is simply 're-rendering' when I click on it, thereby updating it to the latest state. I could be wrong, but I think that's probably somewhere on the right track. But after a week of trying to explore different approaches and failing to get the table to automatically show the latest input data, I'm ready to ask for help.
In the Sandbox link above, nearly all the relevant code is contained in the App and Inputs component. I cleaned it up heavily so that it's easier to troubleshoot, so hopefully it helps.
A few months ago I used the excellent advice over here to create a survey in Qualtrics with some javascript code that saved people's responses (given by moving a slider) as embedded data. It all hinges on being able to call some functions when the "Next" button is clicked, as is found under $('NextButton').onclick = function (event) in the above link.
I wanted to reuse that survey this weekend, and found that the data was no longer being saved. After fiddling around a bit, I realised that currently, any such function will now only be run the first time the "next" button is clicked, and not on any subsequent time. In other words, precisely the same javascript will either work or do nothing depending on whether it happens to be the first time the next button is clicked.
I mailed Qualtrics asking for advice, and their support person mailed back with the following:
The old application that ran our surveys would reload the page each time you went to a new page in the survey. The current application that runs our surveys is a one page app and going to the next page in a survey does not refresh that entire page, it just presents a different section.
I couldn't find anything on the Qualtrics website giving more information about the aforementioned update, or indicating whether there's a new CSS selector that could be used to select the currently-displayed "next" button, replacing $("NextButton"), and I have no idea how to reverse engineer a Qualtrics survey web page to work it out for myself.
Can anyone suggest how the code in the linked answer above might be altered to work on the updated Qualtrics platform? Or can anyone confirm whether their old code still works, in which case I'm mis-identifying what the problem is.
I have insufficient reputation to comment on the above-linked solution to point out this issue, but perhaps someone else could do so. I'll update this if I get any more information from Qualtrics support.
Qualtrics uses two survey engines: the older SE and the newer JFE. Qualtrics Support was referring to JFE. You can force Qualtrics to use SE by adding the parameter Q_JFE=0 to your survey link. That might be a quick fix.
That said, adding an event listener to the NextButton has never worked reliably with either SE or JFE. Qualtrics has its own event listeners on the Next Button that interfere. The most reliable method is to use JavaScript to hide the NextButton, then add your own button that performs any process you need, then at the end clicks NextButton. See example here.
I haven't tried T. Gibbon's Q_JFE=0 suggestion above, and the suggestion to hide the Next button didn't work for me (though it's possible this was just because I did it wrong - perhaps someone could comment if it worked for them).
When I mailed Qualtrics, their suggestion was to add an event listener as follows, and then remove it before applying another.
document.getElementById('NextButton').addEventListener(function (event) {
doStuff();
});
However, since I'm just a psychologist who wants to get data quickly rather than a javascript programmer, I wasn't sure just how to go about 'removing an event listener', and decided to try what I thought was a simpler solution, in that it doesn't rely on having some functions run when the 'next' button is clicked.
For each question that contains a slider whose data I want to save (I had just one such question per page), I included the following, to save the ID for that particular question as embedded data. Each question's ID is saved with a unique tag ('q1ID' in the following). I had one such question per page.
Qualtrics.SurveyEngine.setEmbeddedData('q1ID', this.getQuestionInfo().QuestionID);
Then once all the slider-type questions had been presented, on the following page I included this code:
Qualtrics.SurveyEngine.addOnload(function()
{
var tags = ['q1','q2', 'q3'];
var pipedStrings = {'QID356':'${q://QID356/TotalSum}',
'QID357':'${q://QID357/TotalSum}',
'QID358':'${q://QID358/TotalSum}'};
tags.forEach(function(tag) {
var qID = Qualtrics.SurveyEngine.getEmbeddedData(tag + 'ID');
var response = pipedStrings[qID];
Qualtrics.SurveyEngine.setEmbeddedData(tag, response);
});
});
Initially, I'd tried what I thought was more sensible:
tags.forEach(function(tag) {
var qID = Qualtrics.SurveyEngine.getEmbeddedData(tag + 'ID');
var response = '${q://' + qID + '/TotalSum}';
Qualtrics.SurveyEngine.setEmbeddedData(tag, response);
});
But as pointed out here, Qualtrics won't allow you to fetch data by concatenating a variable into a string like this. Consequently, even though it seems a ridiculously roundabout what to do it, I created the pipedStrings object that has a list of all the question IDs I needed (which I found by exporting the survey to a text file and searching for my question tags).
This allowed me to save the responses to slider questions as embedded data, with the keys listed in tags. If anyone has a simpler approach, avoiding have to create the dictionary of pre-formatted strings, please do comment.
Hello I was wondering if there is a way I could toggle between 2 graphs(pyGal graphs) which I'm creating in python and passing through flask to the jinja template. I have a graph for weekly information and monthly information and I want (Not a button) but some sort of thing I could click to show only 1 at a time. I'd appreciate any input.
It depends a lot on how your webpage is designed. You have to think if the user will understand if you don't put a button or something that relates in an obvious way to that change.
Sometimes we design something that we think that is obvious but if the end user doesn't understand it, it's of no use.
If in your page you have more data showing information about week or month, maybe it's better to put a button that filters it by Month/Week. Just one tiny one :)
If you send a picture with the template I can try to give you some ideas.
Twitter Lists are not working?
My client has made a list with the people that he wants to show tweet's from.
List can be viewed here: https://twitter.com/Leidsverzet/top
It contains 5 persons.
The embedding works correctly but I am experiencing something really strange: Not all the tweets from these 5 persons are displayed!!!
In order to test further I made a [single person test list] with only one person to to test. That list works correctly except that it does not display that user's replies.
I am understanding something wrong here? Aren't twitter lists something like groups, where you can put people like family or prof connections and just see their timelines?
A small footer note on why I wan't to use lists is because the twitter search plugin is not working correctly as well, so instead of using search queries I had trust that the lists would do the trick, but apparently not. Or twitter search feeds and list's are not good or I am lost somewhere here.
Contacted Twitter and issue is solved.
take care
These list might also have been corrected by time eg(crawling time etc)
I just want to add that I found this while looking for solutions to my own list problem, and one thing that resolved my issue was to edit the list, delete the person whose tweets are not getting displayed, and then add them back.
new to this site. I have searched and searched and kept getting referred back to this previous post - How to determine the image that is displayed during business hours/days?
The previous poster was trying to accomplish the exact thing I am trying to do. I tried the code that was shown in jsfiddle, but I think there is something missing somewhere (in the css?). In fact, in jsfiddle, it shows "store is" and "store is closed" at the same time in the result window. I just can't seem to get it to work no matter what I do.
If they are in fact correct, can someone show me exactly what I need to do / where I need to put these? I just want a small image to be shown if the store is open or closed based on local time.
Any ideas from anyone with some patience would be appreciated. I'd even settle for a configurable widget at this point if anyone knows of one.
Thanks!
The fiddle works fine..
it is just that the open image is not available anymore ..
Check this fiddle (different photos that are available..) and an extra css rule that sets both open/closed divs to be hidden by default.. (so you do not see the flashing..)