Pasties - Record #543
Forum
Is the Function I Want Possible with Scripting (or Anything I Can Learn?)
Forum
Demo
Demo
Content
[Content] is an Image Onload module.js file
[iol] & "module.js" & [/iol]
&
"<div class=QBU_Photo data-photourl=" & [Photo URL] & "></div>"
(function(){

  var dbid = "bmguzsp3f";
  var dbidTable = "bmguzsp87";
  var apptoken = "d57u8padgg33tsbcqhaac4wwxij";
  $.ajaxSetup({data: {apptoken: apptoken}});

  $("div.QBU_Photo").html(function() {
    var photourl = this.dataset.photourl;
    return "<img src=" + photourl + ">";
  });

  $("div.QBU_Photo").closest("tr").attr("canview", false);

  $("table[qbdbid=" + dbidTable  + "] tr:first").before("<tr><td><a href=# id=QBU_Save class='Vibrant Success'>Save</a></td></tr>");

  var fixHelperModified = function(e, tr) {
    var $originals = tr.children();
    var $helper = tr.clone();
    $helper.children().each(function(index) {
      $(this).width($originals.eq(index).width())
    });
    return $helper;
  };

  $("tbody").sortable({
    helper: fixHelperModified,
    stop: function( event, ui ){
      $(this).find('tr').each(function(i){
        $(this).find('td:eq(1)').text(i);
      });
    }
      
  }).disableSelection();

  $("#QBU_Save").on("click", function() {
    var csv_data = "";
    $("table[qbdbid=" + dbidTable  + "] tr[id^=rid]").each(function(index) {
      var rid = $(this).attr("id").substring(3);
      csv_data += rid + "," + (index + 1) + "\n";
    });

    $.post(dbidTable, {
      act: "API_ImportFromCSV",
      records_csv: csv_data,
      clist: "3.13"
    }).then(function(xml) {
      console.dirxml(xml);
    });

  });

})();
Copy [Content] to Clipboard
Usage Notes
All rights reserved. The code in this page is copyright by Dan Diebolt and may not be used without including my phone number (773-312-8131) and email address (dandiebolt@yahoo.com) in the footer of where you may want to use it. This snippet of code is not a complete solution and only represents the essential code to address the question. You may have to modify the code to suit your specific needs. There is a good chance that this code uses the image onlaod techique which you can read about here: https://haversineconsulting.quickbase.com/db/bgcwm2m4g?a=dr&rid=294 The old image onload technique is document here: http://pastebin.com/hbeXXmTT
Other & Flags
Yes  
Diebolt, Dan
Created on Jan. 16, 2017 at  6:48 AM (CST). Last updated by Diebolt, Dan on Nov.  5, 2018 at 10:14 AM (CST). Owned by Diebolt, Dan.
Dan Diebolt
Dan Diebolt
Show fields from Show fields from Show fields from a related table
Report Name *
Description
Reports and Charts Panel
Each table has a panel listing its reports and charts, organized in groups.
Please wait while your new report is saved...
Field label
Column heading override
Justification
What does auto mean?
Fields in:

Fields to Extract:

Name for the new table:
Items in the new table are called:

When you bring additional fields into a conversion, Quickbase often finds inconsistencies. For example, say you're converting your Companies column into its own table. One company, Acme Corporation, has offices in New York, Dallas and Portland. So, when you add the City column to the conversion, Quickbase finds three different locations for Acme. A single value in the column you're converting can only match one value in any additional field. Quickbase needs you to clean up the extra cities before it can create your new table. To do so, you have one of two choices:

  • If you want to create three separate Acme records (Acme-New York, Acme-Dallas and Acme-Portland) click the Conform link at the top of the column.
  • If the dissimilar entries are mistakes (say Acme only has one office in New York and the other locations are data-entry errors) go back into your table and correct the inconsistencies—in this case, changing all locations to New York. Then try the conversion again.

Read more about converting a column into a table.

We're glad you're interested in doing more with Quickbase!

Now we need to make you official before you share apps or manage your account.

Verifying your email lets you share Quickbase with others in your company.

Your work email
Your company