Set a Layout to a View in Javascript - kendo-ui

I have this situation:
I have some Views and by default they have assigned a Layout for them. The problem is that in some specific cases, I need to change the Layout of some of these Views in the Javascript file.
I am using this way:
$("#tabstrip-dash").setAttribute('data-layout', 'mobile-tabstrip-layout2');
This solution works only if I reload the application, but I want to change it instantly.
Is there any way to set the new Layout?
Thanks!

Looks like the answer might be something like:
app.navigate("#someId")
I got this info from here: http://www.kendoui.com/forums/mobile/general-discussions/how-to-switch-views-programatically.aspx
Note, in a test I got this working, but in my main project I have not. I'm seeing the error "Uncaught TypeError: Cannot read property 'length' of undefined ". Not entirely sure whats going on, but there are other reports of it (in case this happens to anyone else).

Related

Drupal 8 - Overwriting a specific view page

I have created a view with several pages. As it is displayed to me with the debug mode, I can also use the view:
views-view-fields--foobar.html.twig
Overwrite With me the whole then looks as follows:
views-view-fields--nd-portfolio-filter.html.twig
Now I would like to overwrite a certain page of my view. I can't find anything suitable in debug mode.
According to https://www.drupal.org/docs/8/theming/twig/twig-template-naming-conventions it should work according to the following pattern:
views-view-fields--foobar--page.html.twig
according to this logic it should look like this with me then as follows:
views-view-fields--nd-portfolio-filter--theaterfotos.html.twig
Unfortunately, that doesn't work. "theaterfotos" is the system name of the page of my view.
Do I have a thought error now? Would be grateful for any help.
Thnx Bavra
As of my understanding of your question you want to apply to the template on a specific page of view.
Your logic is right but I think your name was incorrect it should be in this format
[base template name]--[view machine name]--[view display id].html.twig
on your case, it should be like below because views machine name not using "-"(dash in between) on lowercase and underscores
views-view-fields--nd_portfolio_filter--theaterfotos.html.twig
you should try this and clear the cache of drupal. Hope this will helps you
Thanks

Stop Magento/tinyMCE forcing object tag type

So iv been reading about peoples problems with tiny MCE "messing up" code. I understand it isn't, but I have a very minor problem that is become a major problem.
Im trying to add a simple object tag to one of my CMS pages. I need the object type to be "text/html" but whenever I save the page it converts this to "application/x-shockwave-flash"
I don't want to turn off the tinyMCE cleanup option as by the sounds of things this is a really bad thing to do.
So is there a way to stop it changing just the type attribute?
I have tried adding the code to a CMS widget and adding the widget to the page but this get the same altered result.
This thread (Object tag is not working) seems similar, but simply changing the type isn't working for me as it is automatically changing back to flash upon save.
The url i am trying to load looks like this...
(http://www.domain.com/animations/embed/one/o-t-t-d?player_width=100%&player_height=100%) I have been told that this will return flash if it is available or html if not.
Im assuming that because i'm saving the page on a PC with flash available its recognising and changing the type.
Any help appreciated.
You can edit the file js/mage/adminhtml/wysiwyg/tiny_mce/setup.js to make this happen.
Look for the settings array (around line 100). Add 'extended_valid_elements' there, like this;
var settings = {
...
extended_valid_elements: 'object[type]',
...
};
This way, TinyMCE will know the type attribute is valid and won't change it.

Laravel blade debug view name on error

when there is some error in view, L4 shows a nice trace, but cached filename:
open: /var/www/webpage/app/storage/views/1154ef6ad153694fd0dbc90f28999013
howto during view-rendering-to-cache save view's path/name (in a comment or something)?
Or better yet - to show it in the debug-error-page (its called whoops or something?)
Thanks ;)
I don't know how to de encrypt view names , but one method i do is to
{{dd('will you reach here ')}}
Trying to move this line from view to another to watch where php render reach .
I know it is not the right way nor the professional one , but it may help in some cases .
This is not exactly a problema, this is a compiled version of your view.
Laravel Blade System will compile all your views and subviews into a single file and, if you didn't change anything on them it will always try to use the compiled version, to speed up your system.
Sometimes is hard to know wich one of our views is related to that error. Using Sublime text, what I do is to hit CTRL-P (windows) and paste the number of the compiled view (1154ef6ad153694fd0dbc90f28999013) and it will bring it to me right away.
Of course, you won't do any changes on it. This is just way to find the view you have problems in, so you can then find the real file and fix it. If you know wich file is the problematic one, you don't have to do this, go directly to your file.
One way to tackle this problem is add a html comments (not blade ones as they will not be rendered in compiled view) in sections which get echoed.
#section('content)
<!-- FILE: app/views/main/index.blade.php -->
<Your Content Goes Here>
#stop
This html comment will get rendered in the compiled source of the view. Of course you will have to inspect the compiled view first to identify which view is the problematic one. But in my experience, this method work almost all the time.
I created a helper that checks to see if you are working locally or in development mode, It then outputs an HTML comment.
{{ printViewComment('mockup/reports#content') }}
<!-- Template: mockup/reports#content -->
I chose to name the comments like this path.file_name#yeild_name but I only wish this was an automated featured.
I found my answer after looking into source,
when on the Whoops! page, just look for render in the sidebar, there will be the name of the view file...

NSPredicateEditorRowTemplate views not filled with predicate

I have an NSPredicateEditor for which I'm setting up custom template row views.
The templates generate the correct predicate, but when I set the editor's objectValue to display the predicate, the views are not filling. The templates' matchForPredicate functions are working correctly, and the correct template is getting the setPredicate message sent by the editor after I've set the editor's objectValue, but nothing further is happening. Right now, the templates' setPredicate function simply calls super, but I've not seen anything out there that I should do anything differently.
Any ideas would be appreciated.
This was a retain problem; once that was fixed, everything worked as expected.

How to access inner controls through styleManager?

I'd like to know if there is a way to access inner controls of the spark control (lets say Panel) through the styleManager?
I've used the following code to access Panel's CSS properties:
styleManager.getStyleDeclaration("spark.components.Panel")
.setStyle("backgroundColor", "blue");
I'm unable to figure out how to access the inner controls like displayLabel. I know that this is possible using the CSS styling, but I'd like to change their properties at runtime.
How can this be done?
I am not sure if this is still current, but I think what you need to do is to declare the inner classes somehow in your CSS (possibly empty if you don't care). As soon as they exist there, the styleManager can access their values. You can also do something like this:
[Style(name="backgroundColor", type="uint", format="Color")]
In your MXML declaration, and then that style exists.
There are a few related examples here:
http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf687e7-7ff6.html
[This is related to an issue I have myself with the StyleManager and google led me here, that's the reason for the late answer]

Resources