15

I am playing around with x-editable and I am wondering how they do the last example in their demo page.

http://vitalets.github.io/x-editable/demo-bs3.html?c=inline (Custom input, several fields)

I can't find any thing that actually shows you the code for each part. I only can dig through it with firebug but that is more time consuming and I rather just see the parts I need.

Any have the pieces of code that does it?

chobo2
  • 83,322
  • 195
  • 530
  • 832

2 Answers2

12

Yes, @marcb is right!

So here: https://github.com/vitalets/x-editable

Or to be exact: https://github.com/vitalets/x-editable/blob/master/src/inputs-ext/address/address.js

Bart
  • 5,065
  • 1
  • 35
  • 43
  • 4
    For the lazy: `value here $('#address').editable({ url: '/post', title: 'Enter city, street and building #', value: { city: "Moscow", street: "Lenina", building: "15" } });` – Turbo Jul 29 '15 at 23:23
  • 1
    This is disappointing. The support isn't there for an arbitrary set of custom fields as the label in the example suggests. Actually it's support for a 3 field object corresponding to the `data-type="address"` field type, similar to how the `"combodate"` field type results in multiple inputs. Yes, you could write your own extension similar to what's in address.js to handle a different or an arbitrary set of fields in the `value:` object, but that's not really an out of the box solution. :( – jcairney Apr 05 '19 at 18:14
10

The code for this can be found in the X-editable Bootstrap 3 download, under "inputs-ext", and then the "address" folder.

marcb
  • 101
  • 2
  • 4
    I don't 100% get it, do I have to make my own "address.js" class with all those methods? – chobo2 Apr 21 '14 at 20:56
  • 1
    essentially, yes. I personally haven't created a new class as I haven't needed to (yet), however it seems pretty well documented. – marcb Apr 25 '14 at 15:51