view gis_gui/blocks/search.js @ 252:efd2469d1722

geometry-column of tables will be displayed as string
author fknauft
date Tue, 20 Sep 2011 11:19:35 +0200
parents 7f008e782563
children
line wrap: on
line source

$('div.block[id*=search]').livequery(function(){
    var searchblock = $(this);

    // displaying the search result list
    searchblock.find("#searchblock_button").live('click',function(){
	searchblock.find("#searchresults").removeClass("hidden");
      });


    // opening the selected search result
    $(this).find("#search_open_button").click(function(){
	addBlock("blocks/table","table");
	var segment = $(this).parents().filter(".block");
	foldBlock(segment);
      });




    tables = new Array();
    tables[0] = "<TABLE class=\"preview\"><TR> <TH> Place </TH> <TH> Date </TH> <TH> gis_id </TH></TR><TR> <TD> Beijing</TD> <TD> 1848</TD> <TD> 131451</TD></TR><TR><TD>...</TD><TD>...</TD><TD>...</TD></TR></TABLE>";
    tables[1] = "<TABLE class=\"preview\"><TR> <TH> Page </TH> <TH> description </TH> <TH>source</TH><TH> gis_id </TH></TR><TR> <TD> 71</TD> <TD> A description of the [...]</TD> <TD> The Big Book of [...]</TD> <TD> 93128 </TD></TR><TR><TD>...</TD><TD>...</TD><TD>...</TD><TD>...</TD></TR></TABLE>";
    tables[2] = "<TABLE class=\"preview\"><TR> <TH> callno </TH> <TH> object </TH> <TH> kind </TH> <TH> title </TH> <TH> ... </TH></TR><TR> <TD> printing 25 </TD> <TD> book</TD> <TD> xylograph</TD> <TD>Huang Ming dianli</TD><TD>...</TD></TR><TR><TD>...</TD><TD>...</TD><TD>...</TD><TD>...</TD><TD>...</TD></TR></TABLE>";
    tbl_index = 2;

    stats = new Array();
    stats[0] = "114 datasets<br/><b>3 Columns:</b> Place, Date, gis_id";
    stats[1] = "37 datasets<br/><b>4 Columns:</b> Page, description, source, gis_id";
    stats[2] = "53 datasets<br/><b>7 Columns:</b> callno, object, kind, title, dynasty, reign_period, production_begin_year";

    $("#resultlist li").live("click", function(){
	tbl_index ++;
	tbl_index = tbl_index%3;
	$("#preview").empty();
	$("#preview").append(stats[tbl_index]+'<hr noshade/>'+tables[tbl_index]);
      });

});