How to convert a panorama item into page/data grid - xaml

I am new to Windows phone dev. I am following this excellent article ( http://developer.nokia.com/Community/Wiki/Weather_in_Windows_Phone_7 ) and have learnt something about how to load xml data and show it as a useful info in a paronama view. But now instead of panorama i want it to be shown as a page. I am not sure if its in a page tag or data grid tag that I should work with. Can someone please help me with how to convert this piece of code to some thing which can be displayed in a page
// create PanoramaItem
PanoramaItem panoramaItem = new PanoramaItem();
panoramaItem.Header = queries[query];
// modify header to show only city (not the country)
int index = queries[query].IndexOf(",");
if (index != -1)
panoramaItem.Header = queries[query].Substring(0,queries[query].IndexOf(","));
else panoramaItem.Header = queries[query];
// use ForecastTemplate in Panorama Item
panoramaItem.ContentTemplate=(DataTemplate)Application.Current.Resources["ForecastTemplate"];
panoramaItem.Content = pio; // add Panorama Item to Panorama
Panorama.Items.Add(panoramaItem); // query next city forecast

At first, be sure that Pivot is useless for you. Its like Panorama, but Pivot :) See differences here, here, here(nice one) or here
Tried to paste some code here, but SO is not showing tags. So, take a look at <.Grid.ColumnDefinitions> and <.Grid.RawDefinitions>. Dots at the beginning are just for rendering.

Related

Vuetify Data Table jump to page with selected item

Using Vuetify Data Tables, I'm trying to figure out if there's a way to determine what page the current selected item is on, then jump to that page. My use case for this is, I'm pulling data out of the route to determine which item was selected in a Data Table so when a user follows that URL or refreshes the page that same item is automatically selected for them. This is working just fine, however, I can't figure out how to get the Data Table to display the correct page of the selection.
For example, user visits mysite.com/11
The Data Table shows 10 items per page.
When the user enters the site, item #11 is currently auto-selected, but it is on the 2nd page of items. How can I get this to show items 11-20 on page load?
I ended up using a solution similar to what #ExcessJudgement posted. Thank you for putting that code pen together, BTW! I created this function:
jumpToSelection: function(){
this.$nextTick(() => {
let selected = this.selected[0];
let page = Math.ceil((this.products.indexOf(selected) + 1) / this.pagination.rowsPerPage);
this.pagination.sortBy = "id";
this.$nextTick(() => {
this.pagination.page = page;
});
});
}
I'm not sure why I needed to put this into a $nextTick(), but it would not work otherwise. If anybody has any insight into this, it would be useful to know why this is the case.
The second $nextTick() was needed because updating the sortBy, then the page was causing the page to not update, and since I'm finding the page based on the ID, I need to make sure it's sorted properly before jumping pages. A bit convoluted, but it's working.

How to change Page Title with Tag Manager in order to show different title in Analytics?

The best solution would be to modify website that is being tracked and change it to generate more valuable Page Titles.
However, that isn't possible and I would like to use breadcrumbs to provide new Page Title for Analytics.
I've created new variable for title in Tag Manager and added a Trigger for it in a Tag.
And yet the Page Title isn't changing and therefore I ended up wondering should this tag be fired before Analytics tag?
EDIT:
I've now used it with Preview mode and I can see that it is at least trying to set a new value for title. However, the value seems a bit too "unescaped" and I think that there's some hidden characters that cause problems.
EDIT 2:
function() {
var a = jQuery('.breadcrumb_container a');
delete a[0];
var textValues = jQuery(a).map(function() {
return jQuery(this).text();
}).get();
var str = textValues.join(' > ');
return str;
}
There is no need to create a new trigger. You should edit your existing pageview tag and set field of title as indicated below:

Target specific slide in Soliloquy slider with url

Does anyone have any experience with using a url to target a specific slide in a Soliloquy slider? I am using multiple sliders that I need to link to specific slides of from external pages/sites. The Soliloquy Docs provide this info (soliloquywp.com/docs/dynamically-set-the-starting-slide/) as closest to the solution but, for a php noob like me, the explanation is a bit terse and lacking, my fault, not theirs.
The example given in the docs seems to be a custom filter for a specific slide in a specific slider. I need to target slides in multiple sliders with urls. I guess I need help understanding the filter's function. I have commented out what I think each part does. Maybe someone could show me where I'm wrong?
//OP: I don't understand, what ids/slides are represented by the 10 and 2 values in these parameters. Where do I find these?
add_filter( 'soliloquy_pre_data', 'tgm_soliloquy_dynamic_starting_slide', 10, 2 );
function tgm_soliloquy_dynamic_starting_slide( $data, $slider_id ) {
// If the proper $_GET parameter is not set or is not the proper slider ID, do nothing.
//OP: Is the 'sol_slide' parameter for ALL soliloquy sliders in my site or is it the name in the Dashboard given when constructing the slider?
if ( empty( $_GET['sol_slide'] ) ) {
return $data;
}
// Change this if you want to target a specific slider ID, or remove altogether if you want this for all sliders.
//OP: I believe to target ALL sliders in my site I should comment this out. Right?
if ( 51064 !== $slider_id ) {
return $data;
}
// Set the slide number as a config property. Also preventing randomizing slides.
$data['config']['start'] = absint( $_GET['sol_slide'] );
$data['config']['random'] = 0;
// Optionally prevent autostarting the slider. Uncomment if you want that.
//$data['config']['auto'] = 0;
return $data;
}
Basically, I guess I am asking for a little help with implementing this filter to target any slide in any slider with a url. Slim odds, but I'm dead in the water! Big thanks to anyone who can shed some light on this for me.
Complete, correctly functioning answer is here provided the plugin author, of course, duh: http://soliloquywp.com/support/topic/a-way-to-link-directly-to-a-specific-slide/
The value "sol_slide" is generic to any slider created with the plugin. Just put the custom filter provided in the example into your, hopefully, child-theme's functions.php, and construct your urls targeting specific slides like so: http://mywebsite.com/specific-product-page-with-slider/?sol_slide=3. Slide numbering is based on zero so 1 = 2 etc. Works like a charm.

How to specify page size in dynamically in yii view?

How to specify page size in dynamically in yii view?(not a grid view)
In my custom view page there is a search option to find list of users between 2 date
i need 2 know how to specify the page size dynamically? If number of rows less than 10 how to hide pagination ?
please check screen-shoot
I dont want the page navigation after search it confusing users..
my controller code
$criteria=new CDbCriteria();
$count=CustomerPayments::model()->count($criteria);
$pages=new CPagination($count);
// results per page
$pages->pageSize=10;
$pages->applyLimit($criteria);
$paymnt_details=CustomerPayments::model()->findAll($criteria);
$this->render('renewal',array('paymnt_details'=>$paymnt_details,'report'=>$report,'branch'=>$branch,'model'=>$model,'pages' => $pages,));
}
my view
Link
I'm assuming you want the entire list of search result be shown on a single page, no-matter how long it is?
If so, this is quite easy to achive.
As I can see in your code, you are now defining your pageSize to have a size of 10. You can update it to be dynamically be doing this:
$pages->pageSize = $count;
To remove the pagesizes you can change the css of your view file, but for that we would need your view file to see how you defined it.

Accessing the different regions of a border layout

In Sencha's API for border layout it says:
There is no BorderLayout.Region class in ExtJS 4.0+
What I found on various blogs, for accessing the center panel was this:
var viewPort = Ext.ComponentQuery.query('viewport')[0];
var centerR = viewPort.layout.centerRegion;
Again to the docs, I see that centerRegion is a private function (why?), and I don't care to rely on those, for future proofing. Also, there is no westRegion, northRegion, etc...
How does one get to these items?
I could of course get the items inside the regions: The various panels, and such, but I want complete control of the viewport that holds my border layout.
This is what I'm doing now:
var viewPort = Ext.ComponentQuery.query('viewport')[0];
var view = Ext.widget('my-new-tab-panel');
viewPort.layout.centerRegion.removeAll();
viewPort.layout.centerRegion.add(view);
Is there a better way?
Usually, I setup an id for each container I have to work with. So, my center region will have an id and I'll get it with Ext.getCmp() function.
Otherwise, to access to the viewport items you can do as follows:
var viewPort = Ext.ComponentQuery.query('viewport')[0];
var view = Ext.widget('my-new-tab-panel');
viewPort.items.items[0].removeAll();
viewPort.items.items[0].add(view);
If you've defined center region as the first item of viewport, then the above code it's ok but if you've defined it as the third or the fourth, then you have to change the index according to the position of your region (viewPort.items[3] or viewPort.items[4], etc).
Another way is to use query selector:
var cr = viewPort.down('panel[region=center]');
cr.removeAll();
cr.add(view);
However, following this way, you have to query on a precisely xtype (as panel in this case).
Anyway, I think the best way is to use an id for each region.