User Tools

Site Tools


doc:appunti:linux:lezioni:pmapper_dev

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
doc:appunti:linux:lezioni:pmapper_dev [2011/02/21 18:46] – [Aggiungere del contenuto dinamico] niccolodoc:appunti:linux:lezioni:pmapper_dev [2011/07/20 22:00] – [Dialog box con PM.Dlg.createDnRDlg] niccolo
Line 151: Line 151:
 </code> </code>
  
-I numeri interi dovrebbero essere formattati senza decimali, i decimali limitati a 3tutto il resto rimane invariato.+**numeri interi** sono formattati senza decimali, i **float con solo decimali** e tutto il resto rimane invariato. 
 + 
 +===== Dialog box con PM.Dlg.createDnRDlg ===== 
 + 
 +Thanks to Armin Burger for the following details. 
 + 
 +FIXME Add a paragraph //Using p.mapper dialogs with createDnRDlg// to page [[http://svn.pmapper.net/trac/wiki/FaqCustomizations]]. 
 + 
 +<code javascript> 
 +var dlgOptions = { 
 +    width: 640, 
 +    height: 480, 
 +    left: 100, 
 +    top: 50, 
 +    resizeable: true, 
 +    newsize: true, 
 +    container: 'pmDlgContainer', 
 +    name: 'PopupWindow' 
 +}; 
 + 
 +var dlg = PM.Dlg.createDnRDlg( 
 +    dlgOptions, 
 +    'Digitize Point', 
 +    popupUrl 
 +); 
 +</code> 
 + 
 +Some of the options to create the dialog: 
 + 
 +^ ''newsize''    | Defines if the dialog should always be reset to its width/height defined in the options. If false it keeps the dimensions of the state when it was closed last time.  | 
 +^ ''container''  | Defines the ID of a ''%%<div>%%'' element to add the dialog to. But don't worry too much with this, if the container with this ID does not exist it will be created automatically. You should just avoid to use ID's that might already be used for other things (like 'map'). If two dialogs use the same container then opening one will always close the other one if already opened. 
 +^ ''name''       | Should be unique (treat it like an ID, no blanks, no special chars), so taking the name of the plugin directory (which must be unique) is a good idea. But only important if more than one dialog are open at the same time.  | 
 + 
 +Reading the form values and transforming them to ''key=value'' list can be done via the function in PM.Form JavaScript: 
 + 
 +^ ''PM.Form.getFormKVP()''        | Returns everything in a string ready for URL concatenation, like **''%%&key1=value1&key2=value2...%%''** 
 +^ ''PM.Form.getFormKvpObjAll()''  | Returns everything in object/array notation, like **''%%{key1: value1, key2: value2, ...}%%''** 
 + 
 +<code> 
 +resContainer = '#' + dlgOptions.container + '_MSG'; 
 +$(resContainer).html(response); 
 +</code>
doc/appunti/linux/lezioni/pmapper_dev.txt · Last modified: 2011/07/21 09:44 by niccolo