Results browse scrollbar

nassausky

Member
As a teacher did you ever give your students homework? Silly question I'm sure you did. I have some homework for you hehe.

Maybe you know the answer already and don't have to do your homework. The standard dadabik results browse looks pretty good except one thing is bothering me now. The description field is showing up without a scrollbar since it's large. I tried adding a scrollbar using some basic css tricks but I just can't get it to work. Any ideas, tips or code would be very helpful.

Thanks,
Mike
 

nassausky

Member
OK great I have an alternative for now.

Inside business_logic.php:

Around line 5131 (from dadabik 6.2 but I might have changed some code above for another function)
Search for the following line:

[pre]
if ($fields_labels_ar[$i]["present_results_search_field"] == "1" ){ // the user want to display the field in the search results page
[/pre]


Replacing the line

[pre]
$results_table .= "<td>"; // start the cell
[/pre]


with

[pre]
if ($fields_labels_ar[$i]["name_field"] == "Description" ){
$results_table .= "<td><div style=\"height:65px; width:400px; overflow-y:scroll; position:relative; padding-top:0px; margin-top:0px;\">"; // start the cell
}
else{
$results_table .= "<td><div style=\"height:65px;\">"; // start the cell
}
[/pre]


and replace line around 5354
containing:

[pre]
$results_table .= "</td>"; // end the cell of data
[/pre]


with

[pre]
$results_table .= "</div></td>"; // end the cell of data
[/pre]



This code puts every cell in the results table in a division tag and only operates (changes the attributes) on my selected Description field.

Also I had to change word wrap in that cell as follows:

Around line 5328
containing:

[pre]
$results_table .= $field_to_display." "; // at the field value to the table
[/pre]


and replace with:

[pre]
if ($fields_labels_ar[$i]["name_field"] == "Description" ){ //MD fixes description field
$field_to_display=str_replace("<br />","",$field_to_display)." ";
$field_to_display=wordwrap($field_to_display, 48,"<br />\n" ) ;
$results_table .= $field_to_display; // at the field value to the table
}
else{
$results_table .= $field_to_display." "; // at the field value to the table
}
[/pre]

Here is a screen image of what it might look like:
Scroll-Sample.png
 
Top