Sencha Touch - Multiple instance of one panel generated on adding to viewport - sencha-touch

I have generated fieldset (textboxes,selectfield etc) inside panel. After login done i display this panel using bellow code from my controller.js
Ext.Viewport.add({xtype: 'IntakePanel'});
Ext.Viewport.setActiveItem({xtype: 'IntakePanel'});
But after this if i try to inspect i can found two panels are there
And due to this if i try to access fields of panel i got array with length 2/4 etc.
I try to remove it using
Ext.Viewport.remove(Ext.Viewport.getActiveItem(), true);
but doesn't help much.
Please help me on this.
Thanks

I think the framework is reinstantiating your component because when you pass only the xtype, it can't know you are trying to reference the same instance as before. try adding an id to your instance and instead of passing an xtype to setActiveItem, give it the result of a component query.
Ext.ComponentQuery.query('#yourCompoId'):

Related

CefSharp how i click button

= Add to Cart
browser.ExecuteScriptAsyncWhenPageLoaded("document.getElementsByClassName('btn_addtocart').click()")
not working pls help ,, thanks
document.getElementsByClassName returns a https://developer.mozilla.org/en-US/docs/Web/API/HTMLCollection which is an array like object. You cannot call click directly on the collection, you must select an element from with the collection.
document.getElementsByClassName('btn_addtocart')[0].click();
Personally I prefer to use query selector for fetching a single html element.
document.querySelector('.btn_addtocart').click();
https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelector
Anything you are having problems with JavaScript I'd suggest running your script directly in DevTools. See https://github.com/cefsharp/CefSharp/wiki/Trouble-Shooting#javascript-debugging

How to create Framework7 side panel in normal vue?

I'm working with Vue+F7.
Is it possible to create new side panel in Vue, according to my scenario I need something like when app open the first page will come with one left side panel. Now when the user logged in I need to another side panel rather than the first one, because the content I would like to place is different.
If possible can anyone tell me how to create that panel in my example.vue?
Thanks
You can create a component where you sent a Json with the menu data.
For example:
{[
{"name":"name_route1", "route":"#/miRuta1.vue"},
{"name":"name_route2", "route":"#/miRuta1.vue"},
{"name":"name_route3", "route":"#/miRuta1.vue"}
]}
This way you would have the same component (you would use the same panel) but dynamically you would pass the elements that it is going to mount.
you can simply make both panels and show them conditionally based on the loggedIn boolean. with v-show this is very easy. check these out:
v if
v else if
v show

Materialcss modal not working with datatables.js

I am trying to build an admin dashboard using material design framework. As a part of it, I am trying to add modal-trigger element inside a <td></td> tag of a table that uses datatable.js library. But when I click on the trigger no modal is appearing. Did anyone face similar issue before?
I think that what's happening is that your trigger isn't in the DOM when you draw the table, but without seeing your code I can't be sure. Generally, it will trigger a modal when it is clicked or something? You might want to change the actual triggering to clicking on a td with a given class contained within the table so something like this:
$(".modal-trigger").click(function(){//Open Modal});
This would work on the first page but not after the first draw of the table as the event had been registered before the elements were within the DOM. Rather, you'd need to listen to the click within the table like this:
$("#table-id").on("click", ".modal-trigger", function(){//Open Modal});
I hope that makes sense and that it helps, if not perhaps work up a JSFiddle illustrating your issue?

Trying to make dynamically created element draggable

I'm trying to create a dynamic input element that is draggable. Now the problem is I create an element but when I use something like
$("#in"+index.toString()).draggable({cancel:true});
after I append it to the container div, it's not working. Basically it's not working for the dynamically created input element of a certain id. Here's the code and please feel free to point out problems. I could really use some help on this one. Thanks!
http://jsfiddle.net/ithril/hRCun/5/
The problem is that you are creating a new element that is not bound to the UI functions. I would suggest using clone(true,true) and then changing the parameters of the cloned element as need be. You can learn more about clone here. http://api.jquery.com/clone/

attaching Tooltip to item without fixed element 'id'

I'm trying to add tooltips to a Dojo application that I recently inherited. The problem I'm having is that everything is created with dojoAttachPoint identifiers instead of with id's , such as :
so, I can't use "connectId= " when defining the tooltip, until I get a hold of the element's id that I want to connect to. Basically my question is, how can I find the id based on the dojoAttachPoint?
Thanks much for any suggestions!
The attach point is either going to be a domNode or a Widget based on whether it has a dojoType or not so if you have an attachPoint to a widgit then you can access connectid with this.myAttachWidget.connectid assuming that the attachPoint is in a widgets template.