Open a modal from anchor tag but the content is from another page - bootstrap-modal

Is it possible to open a modal from anchor tag but the content is from another page? If yes, can anyone help me on how to do this? Btw I'm using Odoo, there is a default add to cart page in Odoo, so all code there was already default and I can't just get the content of the specific part from add to cart page and load it in my modal which is another page.

You need to write a JS function to achieve this. When clicking on a button, you can listen to button click and show your modal accordingly. Odoo uses jQuery by default so you can call something like this.
$(".button-class").click(function() {
// do some stuff here
// either do jsonRPC to get data from another record.
// add values to the body
// finally show your modal
$(".modal-class").modal("show");
}

Related

Qt: how can I make hyperlink in qpushbutton?

hi I'm trying to make hyperlink in a QPushbutton.
I searched for information that mights help and I found this:
Qt - add a hyperlink to a dialog
this told me how can I use hyperlink at a dialog(or mainwindow.)
However, what I want to is to use hyperlink in the QMessagebox when appears after clicking QPushbutton.
I searched that if I can use qlabel in qmessagebox but I couldn't find any information..
How can I do this?
(Any other way I can apply to make hyperlink by clicking a second button is fine. What I'm trying to do is 1st. click a button and my program will get an url information. 2nd. clicking a second button and it will activate my url)
If all you want is clicking a second button and it will activate my url then you can use QDesktopServices::openUrl() to open a URL. It automatically uses the application the user has configured, i.e. the browser or mail programm depending on the type of URL you give it.

Datepicker can't work with Sammy.js

i've been using datepicker in many of my projects, but this one project, i've got a problem with it.
the prev/next buttons don't act like it suppose to do. when i clicked it, it redirects to the default page. for example, here is the url where i implemented datepicker
$('input#_date').datepicker();
project.dev/index.html?q=123a21#/home
then, when i click prev/next button, it redirects me to default page which is
project.dev/
i have no idea why this one acts like this. has anyone any idea on how to fix this?
EDITED:
i found out source of the problem but still can't figure out a way to solve it.
everytime i clicked next/prev button on datepicker, it always redirects to default router which is $.sammy.get(''). i found out that prev/next button on datepicker is actually an <a> tag without href attribute.
i managed to solve it eventhough (i still have no idea why it happens) by preventing the default event.
$('input#_date).datepicker({
//options
}).focus(function() {
$('.ui-datepicker-next, .ui-datepicker-prev').on('click', function(e) {
e.preventDefault();
});
});

Translating theme: Add to cart button?

I've been translating a theme by simply customizing the HTML, but I've run into a problem:
The "Add to cart" button on a product page. I can translate the label on the button, but when you click the button the text changes from "Add to cart" to "Adding..." and then to "Added!".
Neither "Adding..." nor "Added!" are anywhere to be found the HTML of the theme, so I'm wondering where I should look if I want to translate those?
The "Adding", "Added" response comes from the theme's javascript - unfortunately that's hard-coded in and there's not a way to change it. You may want to try modifying another theme that doesn't use ajax to add products to your cart, like Sexy, Luna, or Nova - then you should be able to have more control over translating your store completely.

Ember.js when use action want to render page current tap as well as new tap

Edit, I am calling function edit and pass the id and get the details then render the edit page in same tab.Now, my problem was I unable to open in new tap when I try to open in new tab using clrl+click is not open. I want to open edit page current tab as well as new tap also..
If you want ctrl+click to open link in a new tab then the link needs to have an href set. This will happen automattically if you use the {{linkTo}} handlebars helper instead of {{action}}. If for some reason you need to use action instead then you will also need to manually bindAttr so that the href attribute is set. Have a look at the source for the linkTo tag to see how that can be done: https://github.com/emberjs/ember.js/blob/v1.0.0-rc.7/packages/ember-routing/lib/helpers/link_to.js#L323

How to add a hyperlink column in an UltraWebgrid that will redirect me to a popup window

I am pretty new to Infragistics controls and finding it hard to add a hyperlink column to the ultraweb grid. Can anyone help me out with this.
Currently, I am binding the data coming from the Database to the grid.
To this data I need to add a hyperlink column "View" that will redirect me to a popup.
I need to pass some values from this page to the popup.
Need pointers if this can be done on Javascript.
I am unable to get the code anywhere.
It would be really helpful if someone can help me out
Regards,
Sunitha
If you know HTML it is actually pretty simple to do. On the Initialize RowLayout method of the UltraGrid and reference the cell you want the hyperlink to go into and within the text property place the link there using HTML and include parameters within the HTML to pass to the popup.
If you are using a fairly recent version of Infragistics, they have a Modal Popup window that you can use which is fairly easy to integrate and use, and with this you do not need a javascript popup. You can use the ClientSideEvent BeforeSelectChangeHandler to open the Modal popup and pass values into there by referring to other cells within the row.