• Content Count

  • Joined

  • Last visited

Community Reputation

295 Excellent

About jmartsch

  • Rank
    Distinguished Member

Contact Methods

  • Website URL
  • Skype

Profile Information

  • Gender
  • Location
    Münster, Germany

Recent Profile Visitors

4,560 profile views
  1. As says, you need to modify the gridOptions.rowClassRules for this. Now I found out how to do this. In your javascript file do this: document.addEventListener('RockGridItemAfterInit', function (e) { if ( != 'RockGridItem_stats') return var grid = RockGrid.getGrid( // set style of all rows to color #cecece remember styles are bad, better use classes grid.gridOptions.rowStyle = {background: '#cecece'}; // this is untested. First is the class to be assigned and second is the condition grid.gridOptions.rowClassRules: { 'rag-green': 'data.age < 20', 'rag-amber': 'data.age >= 20 && data.age < 25', 'rag-red': 'data.age >= 25' } // you can use the grid api like this: // grid.api().sizeColumnsToFit(); //grid.api().setHeaderHeight(48); })
  2. Also I want to know how did you handle translations? For example translating the pager? There are instructions how to at but my general problem is understanding how to modify the gridOptions object.
  3. Hi @bernhard. I would like to change the styling/rendering of one or more header columns. For example I want to change the background color. How would I do that? I found this instruction from the aggrid site but how would I integrate this into RockGrid? Or is there an easy way to add a class to a specific header column? How do I disable a plugin/button? For example the Excel export button? Somewhere in your code I found document.addEventListener('RockGridButtons.beforeRender', function (e) { // Buttons entfernen if ( != 'RockGridItem_stats') return var grid = RockGrid.getGrid( var plugin = grid.plugins.buttons // remove a btton plugin.buttons.remove('refresh') }) which does not work. The the listener event is never fired. Also I found document.addEventListener('RockGridItemBeforeInit', function (e) { if ( != 'RockGridItem_stats') return var grid = RockGrid.getGrid( grid.disablePlugin('excel'); }) which also doesn't work.
  4. That is strange, because Textformatters are only active on the frontend and not in the backend (far as I know). I never experienced a real slowdown with this module active and in use. Maybe it has something to do with your database access, because the module caches the embed code in the database. The module also works with multilanguage fields, as I am using it for that purpose on
  5. I meant this without using a centralized (and included) version number. Just wanted to say that if either the fieldtype or inputfield should change, the version number should be updated in all of the modules accordingly, because I see them as a whole module package.
  6. @bernhard Du bist der Beste I will try to optimize my queries tomorrow based on your post. Also some more questions are coming up as I dive in further.
  7. jmartsch

    Thanks, that is excactly what I need. Great ideas from Ivan. I had the same, but he was quicker
  8. jmartsch

    Hey @adrian, is there an API to turn Mail Interceptor on, before I send emails from one of my modules? I would like to catch emails if I am on my local dev server and forgot to enable the Mail Interceptor in the Tracy Debug bar.
  9. If your module is namespaced on top of your .module file <?php namespace ProcessWire; you can use in your functions $this->log // or $this->pages
  10. This does not really help, as I have no field for the RockGrid because it is created on the fly in my Dashboard module. When I created that file "site/assets/RockGrid/fields/yourfield.php", the code to add the moment.js lib works, but now my grid was empty. My stats.php (thats the name of my InputfieldRockGrid) file looked like this: $this->rg->assets->add($this->config->paths->siteModules . 'FieldtypeRockGrid/lib/moment.min.js'); I think I then have to also copy the code to setup the RockGrid to this file, right? However, I found a much simpler way to add the script, via ProcessWire's own method. So now in my module I have this code, which works: public function __executeRockGrid() { $f = $this->modules->get('InputfieldRockGrid'); $f->name = 'stats'; $f->themeBorder = 'none'; $f->height = 0; $f->pageSize = 50; // set initial pagination to 25 rows $finder = new \ProcessWire\RockFinder('template=stelle', ['title', 'created']); $field = $finder->addField('mitarbeiterId', ['vorname', 'nachname']); $this->config->scripts->add($this->config->urls->siteModules . "FieldtypeRockGrid/lib/moment.min.js"); $f->setData($finder); return $f->render(); } Any complaints doing it this way?
  11. Hey Bernhard, I get an error that moment.js could not be loaded. Then I found a file which says short note: the name of the module in this file is still RockGrid instead of FieldtypeRockGrid. So I tried to do this, but now I get an error `Call to a member function add() on null` What am I doing wrong? Here is my code. I use RockGrid inside of a module: $f = $this->modules->get('InputfieldRockGrid'); $f->rg->assets->add($this->config->paths->siteModules . 'FieldtypeRockGrid/lib/moment.min.js'); $f->name = 'stats'; $f->themeBorder = 'none'; $f->height = 0; $f->pageSize = 50; // set initial pagination to 25 rows $finder = new RockFinder('template=stelle', ['title', 'created']); $field = $finder->addField('mitarbeiterId', ['vorname', 'nachname']); // $sql = $finder->getSQL(); // $finder->sql = "SELECT id, SUM(value) AS revenue, DATE_FORMAT(date, '%Y-%m') AS dategroup FROM ($sql) AS tmp GROUP BY dategroup"; // d($finder->getObjects()); $f->setData($finder); return $f->render();
  12. Hey @bernhard. You should change the link to the repo in your first post to as the URL has changed. Also, is the information that this module is still an alpha correct?
  13. Hi @bernhard. I try to get the path to the result pages but also want a fast query, so I am using $found_in_product_title = new \ProcessWire\RockFinder("title|subheadline%=$qs, limit=25, has_parent!=2", ['title', 'name', 'path' => function ($page) {return $page->path;}]); $found_in_product_title = $found_in_product_title->getArrays(); but the path is empty. If I use $found_in_product_title = $found_in_product_title->getObjects(); instead, the path is returned. How can I get an array returned which includes the path to the page? Thanks in advance.
  14. Because it is simply amazing, has an improved user experience, is more lightweight, better looking and has nicer features than version 4. Almost everybody will profit. Please consider voting at github for this feature: