the Loading... Message in Grid when there is no data. ExtJs Grid - json

In my application, when there are no records on DB, the json i am receiving is as below.
JSON Message: {"totalCount":0,"responseObject":[]}
But in the grid the Loading... mask is not going off. It says Loading even if there is no data as in the image below.
Please suggest me how to get rid of this when there is no data, i want to show the empty grid without this loading mask.

I think I may know what your problem is, because I had the same issue.
For me, the reason why the loading mask wouldn't resolve was not because there were no records, but because I was trying to select the first record in the grid when there WAS none.
This throws a javascript error that looks like this: "Uncaught TypeError: Cannot read property 'id' of undefined "
Because of this error, it stops other Ext javascript processes, and the mask never gets a chance to resolve.
So, to solve this problem, I would make sure that your Store's 'load' event handlers do not try to do things with records that do not exist in the grid. It worked for me.

Related

xcode swift Thread 1: signal SIGABRT/display url data from retrieved website info

I have 2 questions.
1. I keep getting signal SIGABRT and I don't know the issue. There questions didn't help. Project below!
2. When I get data from a website(mine) how would I display it in my table? Thanks.
Download: https://ufile.io/2sso0
The issue you get is when something isn't hooked up properly, like an outlet. Do you have some sort of outlet that you're not 100% sure works? If so, delete and add it again. Also something that I do a lot when I get this issue is to right click(two finger click) on the yellow circle on your view controller. Then if there's a yellow triangle, I click on the x and delete it. That fixes it for me.

Access Violation Exception on Textbox Autocomplete

In textchanged event Access Violation Exception occurs frequently.
it's a security level problem may be. try this: Go to the Project Property page, and then go into the Security Section.
"Enable ClickOnce Security Settings" will be seen checked. uncheck it
reference: https://social.msdn.microsoft.com/Forums/windows/en-US/e599b2e2-3cda-43ad-b15f-a69b4fea1a75/dynamic-filling-of-textbox-autocomplete-not-working?forum=winforms
I too wanted to populate a TextBox AutoCompleteCustomSource using the users input from that same textbox as a filter, so I had the TextChanged event grabbing data to fill the dropdown suggestions list.
I tried so many different ways to fill the data, which all resulted in random or constant Access Violation. If I'm not wrong I finally have it nailed down I think.
It seems that it doesn't matter what method you're using to actually add the items to the AutoCompleteCustomSource. The problem arises when you go to replace those items.
Before changing any of the data in TheTextbox.AutoCompleteCustomSource, you need to first set:
TheTextBox.AutoCompleteSource = AutoCompleteSource.None
Then you can use any method you like to clear and/or refill it:
TheTextBox.AutoCompleteCustomSource.Clear()
TheTextBox.AutoCompleteCustomSource.AddRange(AutoSuggestItems)
Set the AutoCompleteSource back to CustomSource when you're done:
TheTextBox.AutoCompleteSource = AutoCompleteSource.CustomSource
' prevent that annoying selection of the whole textbox text
TheTextBox.Select(Me.TheTextBox.Text.Length, 0)
*Note: If you also set TheTextBox.AutoCompleteMode while changing the data like I was originally, it causes the Access Violation error later. (SO FAR) the above method has worked correctly. I hope this is my last update to this solution :)

FileMaker 13 GetThumbnail Anomaly?

I have a container field named tempImage, set to have a calculated value of:
GetThumbnail(tempImage; 500; 500)
However, when I drag a larger size image into that field, the image does not get resized.
How can I fix this?
Note: The "Do not replace existing value of field (if any)" checkbox is unchecked. Here is a link to a video showing the anomaly.
I don't have a specific answer, but will offer a method to debug this.
Instead of dropping the image into the container, write a script that is triggered by the OnObjectModify that sets another container field using the GetThumbnail() function.
In so doing, you will be able to run the debugger and see if an error is generated by the script. That will give you more information to post here if you have not solved this already.
Reference information:
http://www.filemaker.com/help/12/fmp/html/func_ref1.31.14.html
Here is a detailed blog post about this function:
http://hbase.net/2013/07/11/resizing-images-in-filemaker-pro-12/`

Asynchronous view call in backbone.js when model is updated

I'm trying to make a demo application for practicing backbone.js.
In my app architecture I first designed the model and inside it wrote a code for parsing a JSON file and storing those records in localStorage and then populating model's attribute hotelsdata with the first 10 records of localStorage.
And then whenever I'm calling the backbone.view.extend() I'm fetching the data from model object.
Now, what I want to do is whenever my model is updated my view must also be updated from the new values in the model. I've already tried
model.on('change',function())
trigger but when I'm calling the view.render() method on the change event my page is being updated, but during the period of adding of records on the page my scroll is not working.
So, can anyone please suggest some way in which I can call that view.render() method asynchronously so that my page's scroll would not be affected during the pressing time of view.render().
In short when my view is being updated the scrolling of the page must work.
I think you have a problem of, how we can call it?, brutal render :)..
I should see your render() method to confirm it, but I think in your render you are removing from the DOM a big portion of the page and then recreating it again. This could cause your scroll to messup. And there is not any asynchronous behavior that can help you.
You should recreate the subelements of your View one by one to have a sweet scroll feeling.
(Show us your render() method if I'm completely confuse)

console logging in google chrome

I am writing a Google Chrome Extension and trying to make the transition to coding in HTML, CSS and Javascript from the kind of coding I did 40 years ago. It's a big learning curve but a little bit of console logging would help a lot. (Who remembers the green phosphor displays on the old iron-core memory Sperry Univacs? Now there was a console that could tell you what was going on - mount a tape, change a diskpack or put more paper in the printer.) But I digress.
Just a few days ago, I was able to send messages to the Google Chrome DOM Inspector console log from my content script or background page like this:
console.log="RECEIVED REQUEST FROM CONTENT SCRIPT PEEK.JS";
Later if I inspected the page where that code was injected, I would see that exact same message on the console. If that line executed four times, I would see four instances of that messages in sequence on the console. It was simple but beautiful.
Now, nothing appears on the console unless I type in "console.log" and in this case I see only the last instance of the message. What's the problem here? Did I toggle something off in the debugger? Am I writing the code wrong? Should it be: "console.log("Message Here");" - (this always returns an error) ?
I have spent literally hours trying to find the answer to this question and I can only surmise that the question is so simple that even a well-educated child could answer it. The alternative is to spend more hours trying to find my bugs thru implication or from alert messages. Better to spend my hours learning how to effectively use the inspector for debugging.
For example, yesterday after restructuring what was once working code so that it would pass an array to background from content instead of background requesting each item successively from content, the extension broke, as might be expected. The console displays one error message: "Error during tabs executeScript: Unknown error." with a link that says "chrome/ExtensionProcessBindings:95" on the far right of that same line. Obviously the error message is almost useless. Clicking on the link brings me to the resources panel which displays a blank frame to the right with the words "background.html" This appears to be useless as well.
How is this information at all helpful? It took me another six hours to figure out that I had moved a variable definition to another place in the code so that it was not defined at the time the executeScript line was executed. Had the error message said that a parameter was undefined in executeScript, I could have found it in about ten minutes.
So back to the original question - I WANT A SIMPLE ANSWER - don't tell me to write a function. I saw the console displaying what I wanted two days ago without writing any functions.
Here is your SIMPLE ANSWER: Instead of
console.log="RECEIVED REQUEST FROM CONTENT SCRIPT PEEK.JS";
You should use
console.log("RECEIVED REQUEST FROM CONTENT SCRIPT PEEK.JS");
For console.log():
https://developer.mozilla.org/en-US/docs/Web/API/console.log
I would recommend searching the Mozilla Developer Network for documentation on JavaScript and many browser technologies.
My general suggestion to help with mistyped or out of scoped variables is to use strict javascript:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions_and_function_scope/Strict_mode
This makes certain JavaScript idioms into errors which are detected earlier, and which give more helpful diagnostics. (The quick version is to put the single line "use strict"; at the top of your js files, or if that causes to many problems you can put it as the first line inside any function to do function-by-function migration.)
The reason why console.log = blah would show blah on the console in some situations is that in JS, <left side> = <right side expression> is an expression which evaluates to the same value as just <right side expression>, but it has the side affect of also assigning to <left side>. (This is similar to C assignment expressions.)
Then, in the context you were in, the console will display the result of any expression evaluation. This is different from explicitly calling console.log() which will display the arguments as the intended side effect of that function.
So in that case you were overwriting the standard console.log function with a string, and the entire expression evaluates to that string value, and the console's builtin behavior (not the console.log() function!) would display the result of your evaluation.
In JS most things are mutable, and you can overwrite all kinds of fields and variables, so be aware of this potential gotcha!
Also, a general recommendation for seeking help on the web:
For sites like StackOverflow is to limit your post to a very specific single question. This is because people with similar problems will come here based on web searches or other links, and they need to figure out if this page helps them with their particular problem quickly. If they have to read through paragraphs with multiple questions or anecdotes, this really slows them down. I would guess that's why this question has been downvoted.
If you have multiple questions, make separate posts. StackOverflow isn't a good site for anecdotes about your experience in the past. FWIW- I personally found your background as a programmer on 70's era machines interesting, but many readers may get lost in the details. Those kinds of anecdotes could make a good blog post.