Hi Armin

Thanks for the steer.  Never could remember what jquery extend does, but I
assume it essentially replaces the queryTpl "table" section...?

So I thought that I would use the correct default version from the source
query js for now to prove using the extended code didn't break anything,
before modding the ouputs.

The result just breaks the query dialog  - stays blank, the js below is
what I used and seems ok validation-wise, but get an error about tpl not
defined in pm_cjs.js.  I wonder whether the selection management plugin is
getting in the way, or have I written a duff set of code (more likely).  If
the original version is slightly different (I had modded the header), the
extended code should just overwrite that - yes?

Cheers
Chris

$.extend(PM.Query,
{
    queryTpl:
    {
        "table":
           {"queryHeader": "<div>",
            "queryFooter": "</div>",
            "layers":
                {"#default":
{"layerHeader":"<div class=\"pm-info-layerheader\">_p(Layer):
${description}</div><table class=\"sortable\" cellspacing=\"0\"
cellpadding=\"0\" border=\"0\">",
                    "theaderTop": "<tr>",
                    "theader": "<th>@</th>",
                    "theaderBottom": "</tr>",
                    "tvaluesTop": "<tr>",
                    "tvalues":
                        {"shplink": "<td class=\"zoomlink\"><a
href=\"javascript:PM.Map.zoom2extent('$[0]','$[1]','$[2]','$[3]')\"><img
src=\"images/zoomto.gif\" alt=\"zoomto\"></a></td>",
                         "hyperlink": "<td><a
href=\"javascript:PM.Custom.openHyperlink('$[0]','$[1]','$[2]')\">$[3]</a></td>",
                         "#default": "<td>$</td>"
                        },
                    "tvaluesBottom": "</tr>",
                    "layerFooter":"</table>"
                   }
                }
            }
         }
});




On 16 August 2012 20:09, Armin Burger <armin.bur...@gmx.net> wrote:

> Chris
>
> you could play with the Javascript template settings for the query. Copy
> the existing template from /javascript/src/query.js to your config
> directory into the file custom.js like
>
> $.extend(PM.Query,
> {
>     queryTpl:
>     {
>         "table":
>            {"queryHeader": "<div>",
>             "queryFooter": "</div>",
>             "layers":
>                 {"#default":
>                    {
>                        .....
>                    },
>
>                   "customLayerName1" : {===> YOUR_CUSTOM_CONFIG <===} ,
>                   "customLayerName2" : {===> YOUR_CUSTOM_CONFIG <===}
>                 },
>
> })
>
>
> I think there's no documentation how to use it (at least I never wrote
> one...) so you need to check a bit the existing template and modify it. The
> template can include settings for individual layers, and you can add any
> type of HTML/JS code you need. This includes AJAX calls etc.  The "$"
> prefix defines a variable that is replaced during parsing.
>
> Good luck!
>
> Armin
>
>
>
> On 16/08/2012 20:39, Chris Jackson wrote:
>
>> Hi all
>>
>> Is there a way to load a point layer and when you click a point
>> immediately
>> fire up an external url in say a thickbox fashion using a querystring
>> containing feature attribute parameters.  I guess you would have to have a
>> button that enables some function/plugin to override the default query
>> results window (would it have to be hard-wired to a layer/s or could you
>> have a list of 'usable' layers that would all generate clickable urls)?
>>
>> Any pointers appreciated!
>>
>> Cheers
>> Chris
>> ------------------------------**------------------------------**
>> ------------------
>> Live Security Virtual Conference
>> Exclusive live event will cover all the ways today's security and
>> threat landscape has changed and how IT managers can respond. Discussions
>> will include endpoint security, mobile security and the latest in malware
>> threats. 
>> http://www.accelacomm.com/jaw/**sfrnl04242012/114/50122263/<http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/>
>> ______________________________**_________________
>> pmapper-users mailing list
>> pmapper-users@lists.**sourceforge.net<pmapper-users@lists.sourceforge.net>
>> https://lists.sourceforge.net/**lists/listinfo/pmapper-users<https://lists.sourceforge.net/lists/listinfo/pmapper-users>
>>
>>
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
pmapper-users mailing list
pmapper-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pmapper-users

Reply via email to