Chris

the whole query output is determined by sort of template design. It 
allows for a certain amount of restructuring of the output by changing 
(or extending) the default template, but without modifying directly the 
Javascript code that generates the HTML.

It's also possible to do all the parsing on the PHP site, using eg. PHP 
templates like smarty, but I never tested it. And it will increase the 
amount of data sent to the browser by at least the factor 2.

In general, modifying the "compressed" javascript file is not a good 
idea. For any testing set the /src/ directory below "/javascript/" as 
the JS location. Then edit the src files, then re-compress everything 
uasing the tool under the "utils" part of the SVN. Or, even better, put 
your modified JS code in the custom.js file of your config directory 
(usually "/config/default/"). This overwrites everything existing with 
the same name, best is to use the jQuery $extend(), though.

If you just want to display the number of results in the table header, 
add something in custom.js like

$.extend(true, PM.Query,
{
     queryTpl:
     {
         "table":
            {"layers":
                 {"#default":
                    {"layerHeader":"<div 
class=\"pm-info-layerheader\">_p(Layer): ${description} - Number of 
results: ${numresults}</div><table class=\"sortable\" cellspacing=\"0\" 
cellpadding=\"0\" border=\"0\">",
                 }
             }
         }
     }
});

(the broken line might need to be in 1 single line). This overwrites 
only this specific part by extending the template object "queryTpl" at 
just one place.

Armin


On 27/08/2010 23:02, Chris Jackson wrote:
> Armin
>
> Due to dabbling in not my usual code I am scratching my head to know
> what syntax to use to embed numResult session value in
> pm_cjs.js/pm.query.js as an output.  Going further than that I was
> already trying to add a new session variable in squery.php (eg
> numResult2) beofre your last email, but that was going wrong too (not
> sure how to initiate new session variables in the app)!  A brief insight
> to both items would be appreciated.
> Thanks
> Chris
>
> On 26 August 2010 17:54, Armin Burger <armin.bur...@gmail.com
> <mailto:armin.bur...@gmail.com>> wrote:
>
>     On Wed, Aug 25, 2010 at 3:44 PM, Chris Jackson <webturt...@gmail.com
>     <mailto:webturt...@gmail.com>> wrote:
>       So back to the query.php code,
>      > do you retrieve a count of matched features from the shapefile before
>      > looping through them or is it even possible?
>      >
>
>     You can check the returned JSON string using eg. Firebug and the
>     response for x_info.php. Or check the value in the session variable,
>     The parameter is called "numresults", but if the display limit is
>     reached it returns this value instead of the real number of results.
>
>     For shapefiles you could change this in squery.php, commenting out
>     line 89.
>
>     armin
>
>


------------------------------------------------------------------------------
Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
Be part of this innovative community and reach millions of netbook users 
worldwide. Take advantage of special opportunities to increase revenue and 
speed time-to-market. Join now, and jumpstart your future.
http://p.sf.net/sfu/intel-atom-d2d
_______________________________________________
pmapper-users mailing list
pmapper-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pmapper-users

Reply via email to