doc:appunti:linux:lezioni:pmapper_dev
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| doc:appunti:linux:lezioni:pmapper_dev [2011/07/20 21:39] – [Dialog box con PM.Dlg.createDnRDlg] niccolo | doc:appunti:linux:lezioni:pmapper_dev [2011/07/21 09:44] (current) – [Aggiungere un barra laterale] niccolo | ||
|---|---|---|---|
| Line 2: | Line 2: | ||
| p.mapper 4 utilizza estensivamente la libreria [[http:// | p.mapper 4 utilizza estensivamente la libreria [[http:// | ||
| + | |||
| + | ===== Modificare il codice JavaScript ===== | ||
| + | |||
| + | Il codice JavaScript di p.mapper è compresso e unito nell' | ||
| + | |||
| + | Le modifiche alle funzioni JavaScript si effettuano in questo file e siccome questo file viene incluso dopo '' | ||
| ===== Aggiungere un barra laterale ===== | ===== Aggiungere un barra laterale ===== | ||
| Line 156: | Line 162: | ||
| Thanks to Armin Burger for the following details. | Thanks to Armin Burger for the following details. | ||
| + | |||
| + | In plugins writing or extending p.mapper code, it is nice to use dialog boxes in the p.mapper way. Here it is an example for the **'' | ||
| <code javascript> | <code javascript> | ||
| var dlgOptions = { | var dlgOptions = { | ||
| - | width: 640, | + | width: 640, height: 480, left: 100, top: 50, |
| - | | + | |
| - | | + | |
| - | | + | |
| resizeable: true, | resizeable: true, | ||
| newsize: true, | newsize: true, | ||
| Line 176: | Line 181: | ||
| </ | </ | ||
| - | Some of the options | + | The non-trivial |
| ^ '' | ^ '' | ||
| Line 182: | Line 187: | ||
| ^ '' | ^ '' | ||
| - | Reading | + | Once the dialog is opened, it can be addressed (e.g. to change its content) using jQuery. In the following example if the dialog does not exists, it will be created; otherwise its content is reloaded and it is shown: |
| + | |||
| + | <code JavaScript> | ||
| + | var dlgOptions = { | ||
| + | width: 640, height: 480, left: 100, top: 50, | ||
| + | resizeable: true, newsize: true, | ||
| + | container: ' | ||
| + | name: ' | ||
| + | }; | ||
| + | |||
| + | var popupUrl = PM_PLUGIN_LOCATION + '/ | ||
| + | var dlgObject = $('#' + dlgOptions.container + ' | ||
| + | if (dlgObject.length < 1) { | ||
| + | var dlg = PM.Dlg.createDnRDlg(dlgOptions, | ||
| + | } else { | ||
| + | $.ajax({ | ||
| + | url: popupUrl, | ||
| + | type: ' | ||
| + | dataType: ' | ||
| + | success: | ||
| + | dlgObject.html(response); | ||
| + | dlgObject.parent().parent().show(); | ||
| + | } | ||
| + | }); | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | When using forms, p.mapper has two handy PM.Form JavaScript | ||
| ^ '' | ^ '' | ||
| ^ '' | ^ '' | ||
doc/appunti/linux/lezioni/pmapper_dev.1311190799.txt.gz · Last modified: by niccolo
