Alpha Video Training
Results 1 to 20 of 20

Thread: List control inline editing version 2 - A video to share

  1. #1
    "Certified" Alphaholic
    Real Name
    Lee Vasic
    Join Date
    May 2010
    Location
    Salt Lake City
    Posts
    1,207

    Default List control inline editing version 2 - A video to share

    This is version 2 of inline editing in a list control. I got this idea from DavidK and used some of his code.
    https://www.screencast.com/t/k0dV02IWdO

  2. #2
    Member
    Real Name
    Darren Parsons
    Join Date
    Aug 2015
    Posts
    188

    Default Re: List control inline editing version 2 - A video to share

    Once again - Kudos!

    Would love the code when you're ready.

    Thanks

    Darren

  3. #3
    "Certified" Alphaholic
    Real Name
    David Kates
    Join Date
    Apr 2008
    Location
    Unionville, ON
    Posts
    7,667

    Default Re: List control inline editing version 2 - A video to share

    Nicely done. I feel this is much more natural to the List Control, it will follow the rules of the List Control, it's responsive, no extra controls, and generally just less cluttered. It's simple and elegant... and that's the goal.

  4. #4
    "Certified" Alphaholic peteconway's Avatar
    Real Name
    Peter Conway
    Join Date
    Oct 2005
    Location
    Melbourne, Australia
    Posts
    2,603

    Default Re: List control inline editing version 2 - A video to share

    What I like about this - is it's mobilized, very well done, you are ahead of the AA team on this kind of thing. Well done, a copy would help me get my changes done as well, also I may see you early in the new year, was going to be back in October this year but there's no DEVCON this year so it will have to be 2020. Again - good job Lee.
    Insanity: doing the same thing over and over again and expecting different results.
    Albert Einstein, (attributed)
    US (German-born) physicist (1879 - 1955)

  5. #5
    "Certified" Alphaholic Lance Gurd's Avatar
    Real Name
    Lance Gurd
    Join Date
    Jun 2005
    Location
    Southampton, UK
    Posts
    1,432

    Default Re: List control inline editing version 2 - A video to share

    That is amazing work Lee, very well done, can I have a copy of the code when debugged please

  6. #6
    "Certified" Alphaholic kkfin's Avatar
    Real Name
    Kenneth
    Join Date
    Dec 2006
    Location
    EU
    Posts
    1,535

    Default Re: List control inline editing version 2 - A video to share

    Quote Originally Posted by Davidk View Post
    Nicely done. I feel this is much more natural to the List Control, it will follow the rules of the List Control, it's responsive, no extra controls, and generally just less cluttered. It's simple and elegant... and that's the goal.
    But I assume that components generated source code (Alphas) is still about same. It is simple and elegant just in the video.

  7. #7
    "Certified" Alphaholic iRadiate's Avatar
    Real Name
    Stephen
    Join Date
    Jan 2011
    Location
    London, ON
    Posts
    1,627

    Default Re: List control inline editing version 2 - A video to share

    Awesome Lee! Would definitely love a copy of your debugged version. Thanks for sharing.
    Alpha Anywhere v12.4.6.1.2 Build 6012-5338 IIS v8.5 on Windows Server 2012 in Hyper-V

  8. #8
    VAR Pat Bremkamp's Avatar
    Real Name
    Pat Bremkamp
    Join Date
    Apr 2000
    Location
    Oregon, USA
    Posts
    2,621

    Default Re: List control inline editing version 2 - A video to share

    Lee,
    You and David should get "free for life" copies of Alpha and a free puppy! This is more than slick..it's a lot more valuable than much of what is in the recent updates!
    I have a use for this in the component I'm currently working on.
    Richard, take note.
    Pat Bremkamp
    MindKicks Consulting

  9. #9
    Member
    Real Name
    Sean OKelly
    Join Date
    Sep 2015
    Location
    Charleston, WV
    Posts
    216

    Default Re: List control inline editing version 2 - A video to share

    This is great Lee and David. Would be nice if it worked like that out of the box. Alpha Software should incorporate it - sell it to them Lee!

  10. #10
    Member
    Real Name
    Jonathan Freestone
    Join Date
    Apr 2017
    Location
    West Sussex UK
    Posts
    76

    Default Re: List control inline editing version 2 - A video to share

    Excellent work. Must try and add that in with our own version of directly editing a list control.

  11. #11
    "Certified" Alphaholic
    Real Name
    Rich Fulham
    Join Date
    May 2011
    Location
    Portland, OR
    Posts
    1,018

    Default Re: List control inline editing version 2 - A video to share

    Lee,
    Fantastic! Now how about doing the sync automatically to the server after a specified amount of time. I find that part really tricky and I still haven't got it 100% working. Values in my LIST sometimes get rewritten with the original values from the server.

    P.S. In your app, will you need to handle the possibility of multiple instances this component running in the browser, which would cause control ID clashes and global function name clashes?

  12. #12
    "Certified" Alphaholic
    Real Name
    Lee Vasic
    Join Date
    May 2010
    Location
    Salt Lake City
    Posts
    1,207

    Default Re: List control inline editing version 2 - A video to share

    Here is the code for the 3 code hooks: Also, part 2 of the video to show the problem I was having and how I resolved it:
    Video: https://www.screencast.com/t/6dOttv3nb2X
    Javascript Function
    function updNames() {
    var vrn = {dialog.Object}.getValue('list::StaffList::SysID');
    var listObj = {dialog.object}.getControl('StaffList');
    var fn = $('FNID_'+vrn).value;
    var ln = $('LNID_'+vrn).value;
    var data = {FirstName:fn,LastName:ln};
    listObj.updateTableRow(vrn,data);
    $('FNID_'+vrn).value = fn;
    $('LNID_'+vrn).value = ln;
    }
    ListControl/Fields/XB Custom Control Code:
    function LName_render as c (ds as p, tmpl as p)
    on error goto LName_xbasicError

    rn = ds.data("SysID")
    vln = ds.data("LastName")
    nvln = stritran_multi(vln," "," ")

    LName_render = "<input style='border:none; background: transparent;font-size:11px; text-align:left;' size='12' type='text' name='lname' id='LNID_" +rn+ "' onchange = 'updNames();' value= " + nvln + ">"

    end
    LName_xbasicError:
    LName_render = "Error in custom control xbasic: " + error_text_get()
    end function
    You also need to update the sync button with this code:
    function tempfunction_ca3bc423_91b4_468b_b6ee_6de8603ac9da() {
    {dialog.object}.saveListEdits('STAFFLIST',{rows: 'allRows', ajax: { timeOut: 15000, onAjaxFail: function() { } , onDeviceOffline: function() { } } });
    }
    function tempfunction_144d8660_bd59_4bd1_ad34_51cbeca5ad62() {
    {dialog.object}.refreshListData('STAFFLIST');
    }
    A5.executeThisThenThat(tempfunction_ca3bc423_91b4_468b_b6ee_6de8603ac9da,tempfunction_144d8660_bd59_4bd1_ad34_51cbeca5ad62);
    Last edited by lvasic; 08-13-2019 at 12:50 PM.

  13. #13
    "Certified" Alphaholic
    Real Name
    Rich Fulham
    Join Date
    May 2011
    Location
    Portland, OR
    Posts
    1,018

    Default Re: List control inline editing version 2 - A video to share

    In the *_render functions, try:

    nvln = *HTML_ESCAPE(vln, "B") '-- check documentation for more parameter options.

    ... instead of the stritran_multi. There might be other characters that would mess things up.

    But, the related function "HTMLENCODE( str, flag)" does not do what we need here.
    Last edited by RichCPT; 08-13-2019 at 06:42 PM. Reason: spelling

  14. #14
    "Certified" Alphaholic
    Real Name
    Rich Fulham
    Join Date
    May 2011
    Location
    Portland, OR
    Posts
    1,018

    Default Re: List control inline editing version 2 - A video to share

    Lee,
    What's the deal with the first name field and the xbasic custom control? In the video it looks like there are two nested "input " controls, but only one closing ">" ? Looks like that would generate an html parsing error.
    The Last Name field just has one "input" control.

  15. #15
    "Certified" Alphaholic
    Real Name
    David Kates
    Join Date
    Apr 2008
    Location
    Unionville, ON
    Posts
    7,667

    Default Re: List control inline editing version 2 - A video to share

    You must remember that it's Alpha that has provided the tools... the pathways... for us to be able to create these interfaces. It's up to us to use these tools to produce the UI we need.

  16. #16
    "Certified" Alphaholic
    Real Name
    Lee Vasic
    Join Date
    May 2010
    Location
    Salt Lake City
    Posts
    1,207

    Default Re: List control inline editing version 2 - A video to share

    Rich,
    The video does show old code and I fixed it up before I put the code out there. (That old code worked too, but it wasn't as clean as I like it) It should work. Let me know if there is an issue. This looks simple now, but it was a chore.
    Last edited by lvasic; 08-13-2019 at 07:27 PM.

  17. #17
    "Certified" Alphaholic CharlesParker's Avatar
    Real Name
    Charles Parker
    Join Date
    Dec 2012
    Location
    New Orleans, LA
    Posts
    2,114

    Default Re: List control inline editing version 2 - A video to share

    nailed it Lee! Thanks for sharing!
    NWCOPRO: Nuisance Wildlife Control Software My Application: http://www.nwcopro.com "Without forgetting, we would have no memory at all...now what was I saying?"

  18. #18
    "Certified" Alphaholic iRadiate's Avatar
    Real Name
    Stephen
    Join Date
    Jan 2011
    Location
    London, ON
    Posts
    1,627

    Default Re: List control inline editing version 2 - A video to share

    Got it working! Thanks Lee for your amazing 'out of the box' thinking.
    This is about the coolest thing ever.
    Alpha Anywhere v12.4.6.1.2 Build 6012-5338 IIS v8.5 on Windows Server 2012 in Hyper-V

  19. #19
    "Certified" Alphaholic
    Real Name
    Lee Vasic
    Join Date
    May 2010
    Location
    Salt Lake City
    Posts
    1,207

    Default Re: List control inline editing version 2 - A video to share

    You're welcome. Glad to share.

  20. #20
    "Certified" Alphaholic Lance Gurd's Avatar
    Real Name
    Lance Gurd
    Join Date
    Jun 2005
    Location
    Southampton, UK
    Posts
    1,432

    Default Re: List control inline editing version 2 - A video to share

    Excellent work Lee, working for me thank you

Similar Threads

  1. Replies: 34
    Last Post: 08-09-2019, 12:24 PM
  2. Replies: 6
    Last Post: 09-30-2018, 06:53 AM
  3. List Box with Checkbox and post to SQL -- A Video to Share
    By lvasic in forum Mobile & Browser Applications
    Replies: 5
    Last Post: 03-28-2018, 09:01 PM
  4. Make the list control look like the IIS Menu - A Video to Share
    By lvasic in forum Mobile & Browser Applications
    Replies: 3
    Last Post: 10-30-2017, 10:35 PM
  5. List Control with Google Org Chart -- A video to share
    By lvasic in forum Mobile & Browser Applications
    Replies: 9
    Last Post: 06-22-2017, 09:02 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •