I have a website for my Theatre Institute and on the homepage, I have a Slideshow with Two Repeaters on two different slides connected to two different datasets. I use them to display event information/status from my database collection.
Slide1: recentRepeater <-- recentDataset <-- myCollection (For Recent Events)
Slide2: upcomingRepeater <-- upcomingDataset <-- myCollection (For Upcoming Events)
The Problem
While loading, the dataset2 data is shown in repeater1 i.e. RECENT EVENTS gets displayed in the UPCOMING EVENTS section and it gets corrected after fully loading. Being the first thing to be shown on the site, I do not want it to get messed up. This is a negative impact on my website
How It Works
I have stored dates of the Event in the database as a number in YYYYMMDD format. For example:
20-April-2019 ---> 20190420
I have properly connected the datasets to the repeater elements, set the dataset result limit to 2
I sorted the results to be produced based on the YYYYMMDD number
Ascending for upcomingDataset
Descending for recentDataset
I generate the YYYYMMDD format number for that day and filtered the results produced by the dataset by the .setFilter() function
$w("#recentDataset").setFilter(wixData.filter()
.lt("dateNumber", YYYYMMDD_today)
)
$w("#upcomingDataset").setFilter(wixData.filter()
.ge("dateNumber", YYYYMMDD_today)
)
How can I prevent this from happening..?
Thanks in Advance
It's hard to say what's going on without actually playing with your site. I think both of your datasets are connected to the same collection. I would guess the problem is that the dataset is only being filtered after the page is loaded. You can verify this by turning the console to verbose mode in preview.
If that is indeed the problem, I can think of three possible fixes/workarounds:
Set the filter's in the dataset settings instead of setting them programmatically. (This is the easiest option.)
Hide the repeaters until the filters are set. (This is a bit of a hack.)
Store the promises returned by the setFilter functions and return them using Promise.all() from the onReady(). (This is the fanciest option. I think it will work, but if you don't need to set the filters programmatically, you might as well do option 1 instead.)
Related
Ordinarily, this is a very simple thing. My issue is I can't seem to get multiple values, so I'm guessing it's a format issue? In my report, here are the default values:
When I preview the report in VS, it shows up exactly as it should, and obviously, I have the multi-select setup correctly:
NOTE: The values of 2 and 3 are the ID's in the query. This is done to utilize the indexing on these values as opposed to just pulling up a big list of strings, so it's finding the ID but actually displaying the "description" in the drop-down.
After the report has been deployed, I discovered that within the options of the report (click report, go to Manage, then navigate to Parameters) this is where there seems to be the hang up. I can select just 2 or just 3 and there's no problem, it will use either of them as the default. I've tried various formats to use 2 AND 3 but have had no luck and get the error The value provided for the report parameter 'Model' is not valid for its type. (rsReportParameterTypeMismatch). I'm not sure why the default values selection in my first screenshot doesn't take care of this, but for whatever reason, the last screenshot appears to override this functionality. Any idea as to how I might get my 2 values?
I figured it out. Pressing enter to go to the next line, no comma or other separator will get this to work.
The Extjs Itemselector component has methods like getValue, getSubmitData, getSubmitValue which will return the keys of the records that are selected.
I am looking for a better way than taking the keys of the records selected from the component and fetching for the record from the store by searching the store in a sequential fashion. This is a very time expensive solution which is not working well for me since the itemselector has a large number of records.
Question : is there a way to retrieve the displayed string/value (in the selected part of the itemselector) along with the keys directly from the component and not as above ?
thanks
Nohsib
This works in my code to get an array of all the records which you can then get the values from, it may not work in yours if you have a different version of Extjs:
itemSelectorField.toField.store.getRange();
Oh and if you want the display values as a string list:
itemSelectorField.toField.store.getRange().collect("display_value_propery_name").join(",");
I've searched for days and not found a clear answer for this.
I'd say I'm intermediate with Drupal (at best). I'm using Views, Panels, CCK, and the Date modules (among others, that may not relate to this question)
I've got a content type of Shows (plays), that has a date range field (from the date module) that is the run date of the show.
I've got 3 views blocks that I filter using the Content: Show Dates - start date and Content: Show Dates - end date fields. These display a list (links) to shows that are of 3 categories, now playing, upcoming, and past shows. They work fine.
Now for the tricky part (for me). I want Panels (Node rewrite for Shows) to decide which one to display in the sidebar while looking at a Content:Show based on whether it is currently running, yet to run, or in the past.
What are the steps to make this happen?
thanks!
jason
Edit: I'm working with Blocks too.
I would suggest to create 3 views (not necessary blocks if you have enabled the "Views content pane" module), one for each date option with a nid as Contextual filter and a display of Content:Node. Then add all the 3 views in one panel page variant one after another. Probably you already have these blocks. So you can clone them and just add a nid Contextual filter.
Another option is to create 3 different variants for the same node type and add a Selection Rule for the Show Date field (Selection Rules screencast). If there are no filters for the date field add some php code. Here is an example.
So I'm not a programmer, but my friend is. He's trying to help me develop a web/phone app but we are stuck because I'm having trouble communicating to him an idea and he is having trouble understanding. One or both of us is a moron ;) Part of the problem is that I don't even know where to search for the answer cuz I don't know the specific search terms...believe me I've tried...and I've searched stack overflow as well. Here is the problem:
Short Question:
Websites (like hotel search) allow you to search for rooms by selecting checkboxes in certain categories (i.e. smoking/nonsmoking, stars, size of bed, near downtown, etc.). Certainly these sites are referencing a large database of hotels in a city.
How can you create a site so that as you check boxes (narrow your search), other options which are no longer available are dynamically "grayed out" or disabled on the fly so you cannot check those boxes. So if I were to check 4 stars and that excluded all smoking rooms based on the database, then the option to check "smoking" would be disabled.
The key to this is that the site is querying a database as you click boxes, then based on the results of that query (which is presumably many rows of data (a subset)), it is analysing that subset of data to determine whether checkbox options should be on/off, then dynamically "graying out" specific options that are no longer available. Once you got to only a single possible result, then the site would pop up the website for that hotel (or some other action).
What is this called? Where can I get more information on this. Any pointing toward the right direction would be tremendously appreciated.
Thanks so much in advance!
Roy
HERE IS AN EDIT TO ORIGINAL QUESTION...HERE IS AN EXAMPLE:
So here is my sample database. Each Column (i.e. AA, AB, AC) represents a checkbox. '1'= True, '0'= False, and '2'= Either. Therefore, if you click checkbox AA, then only the top three rows would meet the criteria of AA=True. So query would return the top three rows. The '2's could be either True/False so since they don't affect outcome, those checkboxes should be disabled and only the checkboxes CA,CB, & CC should remain choosable. If you then click checkbox CB, then result ZYX would be output.
Conceptually, How do you go from the initial click to the point where the database is queried and the results are used to dynamically change the menu. People have suggested javascript but i am not looking for a language. I am more looking for the concept. I was thinking that the query would return a new "temp" array with just the top three rows. Then each column of this "temp" array would be queried to see if it contained a '1' in any of the rows. If it did, then that button would be turned "ON". If it didn't then that button would be turned "OFF". Is this confusing? Am I asking for too much ;)
This sounds like javascript could help. For example, using jQuery, you can dynamically send queries to databases based on whatever you click on checkboxes, and then reload a particular section of the webpage. Javascript can also dynamically disable checkboxes.
I have a VB2005 winforms application that will loads city data from my database table. This is to ensure that the user enters the correct city spelling, in order to receive an accurate quote. Currently, there are about 150K cities that are being loaded to the dropdown listbox on page load. It takes about 30-40 seconds for that page to load.
My initial thought was to allow the user to select the state first. Then load the city values. But the user has the option of going back and requesting a quote for a different city / state.
Is there a more efficient way to handle this?
Quotes are based on state and city name? If so, your approach sounds good, but consider basing quotes on zip instead, or zip/city name. Not everyone will find their city in your 150K list, and some don't live in named cities at all.
For starters you could have a BackgroundWorker or Thread load the data in the background into an array or list. You'd then pass this data to the comboBox when needed.
If you use this method, you must find a way of reindexing the fields from time to time though.