cforms II User Forum

Registration is currently disabled.
Guest

FAQs

Login form protected by Login LockDown.


Lost password?
Advanced Search

— Forum Scope —

  

— Match —

   

— Forum Options —

    

Wildcard usage:
*  matches any number of characters    %  matches exactly one character

Minimum search word length is 4 characters - maximum search word length is 84 characters

Topic RSS Related Topics
Implementing custom column from form in colModel
Tags: ***
August 23, 2013
9:36 am
Henri van Blarenberg
Guest

Dear Devs:

In \"Form Submissions\" display of \"Tracking\" page, I would like to implement (a) custom column(s)  namely \"First Name\" and \"Last Name\" respectively, extrapolated from textfield inputs from a single form.

In 'c-forms-database.php', 'colModel' (line 56) displays:

colModel : [
 {display: '#', name : 'id', width : 40, sortable : true, align: 'center'},
 {display: '', name : 'form_id', width : 240, sortable : true, align: 'center'},
 {display: '', name : 'email', width : 200, sortable : true, align: 'center'},
 {display: '', name : 'sub_date', width : 160, sortable : true, align: 'center'},
 {display: '', name : 'ip', width : 100, sortable : true, align: 'center'},
 {display: '', name : 'name=\"cf_field_7\"', width : 200, sortable : true, align: 'center'} // psychopomp : added
 ],

 

As you can see, I've attempted implementation of additional column 'Last Name', which corresponds with 'cf_field_7' of my form. This method clearly does not work. Comparable snippets from working code encoded in Jade (JavaScript) appear as such:

'Form' equivalent:

p Name (Head of Household)
  .controls-row
    input(class=\"span3\", type=\"text\", placeholder=\"First\", required, name='nameFirst', value='#{user.first_name}')
    input(class=\"span3\", type=\"text\", placeholder=\"Last\", required, name='nameLast', value='#{user.last_name}')


'Form Submissions' equivalent:

table.table
  thead
    tr
      th Full Name
      th Email Address
      th Date Submitted
      th Date Updated
      th Status
  tbody
    for u in users
      tr
        td.name
          a(href='/users/#{u._id}')
            p=u.name
        td.email
           p=u.email
         td.dateSubmitted
           p=u.prettySubmitDate
         td.dateUpdated
           p=u.prettyUpdateDate
         td.status
           a(href='/users/#{u._id}')
             p=u.status


To summarize my question, then: how might I extrapolate data from a given form, so as to populate in a custom \"Form Submissions\" column? Simply put, I would like to review/order (i.e., asc/desc) a list of form submissions by the users 'Last Name' &/or 'First Name'. 

Any information concerning the above shall be sincerely appreciated.

Yrs.,
Henri van Blarenberghe 

Forum Timezone: Europe/Berlin

Most Users Ever Online: 959

Currently Online:
26 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

tracedef: 43

mores: 21

Gyrus: 20

frozenwaste: 18

asuffredini: 15

photoworks: 14

Member Stats:

Guest Posters: 3731

Members: 1463

Moderators: 3

Admins: 2

Forum Stats:

Groups: 1

Forums: 4

Topics: 5331

Posts: 18693

Newest Members: juredujmovic, dreamkeeper, rajattyagi, wrokaa, lukass

Moderators: Paul (421), cnymike (8), sonika (95)

Administrators: Oliver (6400), Nicky (3)