https://antibiotiqueaugmentin.com/surdosage-augmentin-bebe/
× Welcome to the ToolsJX forum!


Is there any way to add an alphabetic index

  • mattburris
  • mattburris's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
9 years 9 months ago #3087

I am using the Tables component for a members directory.

Could you give me a hint on how I could add an alphabetic type index, like the way that pagination works. something like this:

"A..B..C..D..E..F.......Z"
And each letter would be clickable and bring up last names that start with that letter.

I would be glad to modify CSS and even some code if needed, I just need a push in the right direction.

Please Log in or Create an account to join the conversation.

  • mattburris
  • mattburris's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
9 years 9 months ago #3088

After some searching and trial and error, I found that I can create a link that will do an advanced search on the table, like this:
"index.php?option=com_grid&view=view&gid=3&aso=begins&data_search=memberlast_no_mid|B"
That link will display all the "Memberlast_no_mid" entries that begin with the letter "B", so I think I'm on my way.

Is there a way to add a "reset form button"?

Thanks

Please Log in or Create an account to join the conversation.

  • mattburris
  • mattburris's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
9 years 9 months ago #3089

I'm hoping I can get some assistance getting this code inserted into the "GridView.php" file...

I would like to have the Alphabetic Pagination placed on top of the grid, so I assume I would insert it right at the end of the "Header and Search Menu Layout"

Here is my HTML code that works to change the page:

<a href="?option=com_grid&view=view&gid=3&aso=begins&data_search=memberlast_no_mid|B" class="pageNum">B</a></td><td style="border:none;margin:0px;padding:0px;width: 1.5em ;text-align:center;padding:0px 1px 0px 1px;">
<a href="?option=com_grid&view=view&gid=3&aso=begins&data_search=memberlast_no_mid|C" class="pageNum">C</a></td><td style="border:none;margin:0px;padding:0px;width: 1.5em ;text-align:center;padding:0px 1px 0px 1px;">

and here is the code that I'm using as an example from GridView.php:
$field['output_script'] .= "<td style=\"border:none;margin:0px;padding:0px;width: 1.5em ;text-align:center;padding:0px 1px 0px 1px;\">";
							$field['output_script'] .= "<a href=\"javascript:;\" onclick=\"searchjx('".$this->ajaxURL("", "", $i)."', '$this->_ID');\" class=\"currentPageNum\" >";
							$field['output_script'] .= "<b>".($i+1)."</b>";
							$field['output_script'] .= "</a></td>";

Any help would be appreciated

Please Log in or Create an account to join the conversation.

  • mattburris
  • mattburris's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
9 years 9 months ago #3090

Much more specifically:

how to get this:

$title.= "<a href=\"javascript:;\" onclick=\"searchjx('".$this->ajaxURL("", "", $i)."', '$this->_ID');\" class=\"currentPageNum\" >";

To do this:
<a href="?option=com_grid&view=view&gid=3&aso=begins&data_search=memberlast_no_mid|C"
where "C" is just a letter sent to search.

Please Log in or Create an account to join the conversation.

  • mattburris
  • mattburris's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
9 years 9 months ago #3091

I've placed this:

foreach(range('A','Z') as $letter) 
		{ 
		$title.= "<td style=\"border:none;margin:0px;padding:0px;width: 1.5em ;text-align:center;padding:0px 1px 0px 1px;\">";
		$title.= "<a href=\"?option=com_grid&view=view&gid=3&aso=begins&data_search=memberlast_no_mid|".$letter."\"class=\"currentPageNum\">";
		$title.= "<b>".$letter."</b>";
		$title.= "</a></td>";
		}
in the GridView.php, and it works, but I would still rather do it through the javascript url than what I'm doing.

Please Log in or Create an account to join the conversation.

Moderators: tomaz
Time to create page: 0.122 seconds

Contact Us

Contact us on Discord

Contact us on Facebook