We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 26016
    • 561 Posts
    Greetings, All,
    I just tried MODx for the first time the other day. After writing bits of code here and there, and test driving a lot of pre-built CMS stuff, this really looks excellent. A very active community, too, and that’s great!

    Along with simply saying hi, I thought I’d try to contribute something. If you’re interested, read further. I wasn’t quite sure where to put this, though I suppose it could go under General Support.

    I had put together a crude working prototype of my desired application, and decided to use the Datagrid widget. It seems that the Datagrid has received mixed reviews around here, but I often find the need to simply display lines of stuff from tables, so I thought I’d give it a shot. It had been working nicely so far, but I was puzzled that the "Empty Message" field would not display when no rows were returned.

    I’m not an expert PHP programmer, but I am strong on debugging, and I found the problem. wink

    Here’s the deal: in tmplvars.format.inc.php at around line 200 we have an errant line.

    Here’s what it said before:
    $grd->noRecordMsg =$params[’nrmsg’];

    Here’s the change:
    $grd->noRecordMsg =$params[’egmsg’];


    Bing-bing-bada-bing, the message works. I had written a hard-coded solution first, but this is obviously cleaner. I hope this helps, and my best wishes to everyone out there. My apologies if someone has already published this fix, but I haven’t seen it anywhere.

    I hope to write some nice apps with this system! I think I heard that OpenGeek wrote a very advanced snippet for this sort of thing, and I’ll have to check it out.

    Now if I can just figure out how the sort order works, I’ll be even further. wink I have been handling that with ORDER BY clauses for now.

    Best, Samba
      MODx and Wordpress development
      Linux, PHP 5.2, MySQL 5.0, Evo 1.05, Revo 2.08-pl, Firefox 4
      • 7923
      • 4,213 Posts
      Welcome to the community samba. Many thanks for the inspector clueso work and the bugfix!

      Quote from: samba at Jul 25, 2006, 03:44 PM

      I think I heard that OpenGeek wrote a very advanced snippet for this sort of thing, and I’ll have to check it out.
      That would be the MakeForm and MakeTable classes, i think.

      Have a happy time modx-ing! grin


        "He can have a lollipop any time he wants to. That's what it means to be a programmer."