ExtJS 4: Data store loaded using proxy shows 0 length - extjs4.1

I have 2 stores, the 'selected store' loaded using data and the other 'all store' loaded using proxy. I want to remove from 'all store' what is already present in 'selected store'. I am using the store.remove method to accomplish that. When I was testing using inline data in the 'all store' it was working fine but when I switched to Ajax proxy it doesn't work any more. However the data continues to be displayed properly in the grid to which this store is attached. I used console.log to see 'selected store'.data and 'all store'.data. I notice that the 'all store' has items, and keys and length set as zero. When I expand the node in Chrome console I do see the details populated though. See attached (second entry; first is the 'selected store' - loaded using data). Any idea what I may be doing incorrectly.

After doing some more research on the Internet found the problem and solution. The code was progressing before the store could be loaded. Had to put the code for remove() in a callback for 'load' event. Found solution # http://www.sencha.com/forum/showthread.php?167381

Related

DOM not refreshing with Selenium (IE, Chrome and VBA)

I'm using Selenium Basic to collect data from a website and store this into a database. The page I'm scraping is dynamic and loads more information as you scroll. I've been able to address most of this by using the implicit/ explicit waits, etc.
I am capturing all the IDs necessary to create the click action, which opens up another javascript popup for me to collect information there. However, even though I've been able to get these new IDs when the page loads by scrolling, when the app uses that new ID to click, I'm getting an error saying the element cannot be found. This is preventing me from opening up the javascript windows for these newly loaded rows.
When I go to collect this new data, the elements don't exist even though I was able to get the IDs for them.
When I look at the DOM in the browser and page source, all of it is there, so I don't believe it's an issue of letting the browser load.
I've tried utilizing the wait methods (implicit/explicit)...I've even put in hard 60 second waits through the routine. No matter what I do, the routine bombs out after the first 10 rows because it can't find the elements to the data it found after scrolling. I've also tried this using Chrome as well.
Unfortunately, the website needs to be private, so I can't provide the full code. The issue that's happening comes here:
driver.FindElementByXPath("//*[contains(text(),'" & DBA!ParseID & "')]").Click
The error I get is "Element not found for XPath("//*[contains(text(),'ID12345"')]
ParseID is the ID found from parsing elements within the body tag. So, I am able to collect all the IDs after loading all the data, but when it goes to click using the above code, it only works for the initial 10 rows. Everything loaded after that will not work (even though they've been loaded in the Browser for quite some time).
What I should be getting is, say 20 IDs which can create 20 clicks to javascript pop-ups to get more information. However, I am getting 20 IDs but the ability to only click on the first 10, even though I've loaded the entire page.
This issue hasn't been resolved the way I initially expected, but I've accomplished what I needed through a different and more efficient way.
First, when I researched this further by removing certain IDs in my loop, I noticed that this really didn't have much to do with data updating in the DOM or browser, but rather the ID itself not being found by a (still) unknown reason. It actually seems very arbitrary why it's bombing out. The ID matches the ID in the DOM, but when the string is being moved to the XPath, it can't find it in the DOM. I'm not sure why this would occur unless the string is breaking when being passed somehow, but I'll just let that one remain mysterious until someone smarter comes along!
What I did to accomplish what I needed is loop through the actual class N times, and pull the elements I needed within the classes. Rather than use the ID above as a unique identifier, I used the count of class web elements as the identifier. This worked with 90% less code.
Thank you all!

View Does Not Reflect Updated Model

I have a form submission using HTML helpers and a p tag that displays a simple count.
On page load, the count in the p tag is obviously 0, which is derived from a list in the model by calling #Model.Individual.Count. After the form is submitted, I'm expecting the Individual list should have a Count of 1. This is indeed the case when I'm debugging it through Visual Studio. I can see it being updated in the model and hitting the breakpoints in the View and #Model.Individual.Count has a value of 1. But then when the page loads in the browser, the value in the p tag still says 0.
I have no idea what is going on since the debug value says 1 but it displays 0 in the browser...
It appears this was due to page life-cycle events and at which times certain scripts were being loaded during the page events. Additionally, since I have desktop and mobile scripts running on the same .cshtml file (loading them or not loading them depending on the screen size), conflicts were occurring.
Overall, the problem was with scripts being fired at the correct times during the page life-cycle.

Bigcommerce Stencil Recently Viewed Items

I am trying to display recently viewed items in a Stencil theme, but am not able to get the data on the page. I am calling the following Front Matter attribute marked as global (available on all pages) here.
Stencil Docs example
recently_viewed: null Boolean indicating whether to display recently viewed products. No filtering available.
https://stencil.bigcommerce.com/docs/front-matter-variables
recently_viewed: true
When I inspect the JSON on the page by appending '/?debug=context' to my URL, there is no data containing recently viewed items.
Has anyone else successfully displayed recently viewed items on a page in stencil?
Thanks.
This feature is currently only working for logged in customers. If you are seeing this behave abnormally from that, please let us know. It does not have feature parity with Blueprint themes' sideproductrecentlyviewed.

Worklight JSON store load method not populating search fields

I am working on the below example.
http://public.dhe.ibm.com/software/mobile-solutions/worklight/docs/v610/JSONStoreAPIBasicsProject.zip
When I add the data locally by using the 'Add Data' button, when the data gets displayed at the top contains name & age as search fields. Perfect.
But when I load the data from the adaptor with the button "Load Data from Adaptor' option. I don't see the search fields getting displayed in the output.
What could be the reason & will it have any effect on the searching capabilities ?
Thanks..Johnson
I cannot confirm this. After playing with adding data and loading data from the adapter, I clicked on "Find all" and it produced the following table. As can be seen, all data is there.
In any case, you can confirm all data is loading by looking at the response. The table is filled using data from it. It looks like JavaScript/HTML error rather than anything related to JSONStore.
Provide steps to reproduce it exactly.

Sencha Touch: How to read certain record from the store?

I have an application that has 3 level of data depth:
list of presentations
presentation detail
presentation slides
Right now when user came to the app he's presented with list loaded from JSONP store. He click on one item and the callback function receives the record. It pushes it into new view - the detail and displays it. User can disclose presentation slides from there - data record is passed from detail again.
Problem is when user refreshes the page or came from URL. If he came to url like /presentations/slides/1, he wants to see the slides for presentation id:1. Problem is that as long as he wasn't at the list, data was not loaded and because it was not loaded, it was not passed to the detail and the detail didn't pass it along to the slides view. So I have no data.
But I still have the ID! Comming from the PHP's Zend Framework, I would call something like: this.store.find(1), but I can't find any way to do this.
How do I load something from the store based on it's record.data.id?
To add more, store.load() seems to work asyncronously, so when I do:
store.load();
store.each(function(rec){console.log(rec);});
It wouldn't work with JSONP store, because the data is not loaded yet. But when I use Chrome Debuger and pause the execution to let the data load, it works :(
You are correct the load is asyncronously so all you have to do is use the callback function of the store. You can find an example here How to get data from extjs 4 store