Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jan 31 2019 15:58
    truckingsim commented #152
  • Jan 31 2019 15:16
    RomanRabirokh commented #152
  • Jan 31 2019 15:05
    jcrawford commented #152
  • Jan 31 2019 15:05
    jcrawford reopened #152
  • Jan 31 2019 15:05
    jcrawford commented #152
  • Jan 31 2019 14:48
    RomanRabirokh commented #152
  • Jan 31 2019 14:42
    jcrawford commented #152
  • Jan 31 2019 14:42
    jcrawford closed #152
  • Jan 31 2019 14:42
    jcrawford commented #152
  • Jan 31 2019 14:40
    RomanRabirokh commented #152
  • Jan 26 2019 07:36
    masteriii commented #163
  • Jan 24 2019 17:43
    truckingsim commented #163
  • Jan 24 2019 11:43
    masteriii edited #163
  • Jan 24 2019 11:40
    masteriii opened #163
  • Jan 20 2019 18:47
    Itay4 opened #162
  • Nov 28 2018 09:33
    agil-NUBBA closed #150
  • Nov 28 2018 09:33
    agil-NUBBA commented #150
  • Nov 28 2018 09:08
    reloxx13 commented #83
  • Nov 28 2018 08:46
    reloxx13 commented #83
  • Nov 28 2018 08:24
    reloxx13 commented #150
Adam Heim
@truckingsim
Just change your value to item.Id
Al Grant
@bigalnz

So I just change:

        preprocessData: function (data) {
            var offences = [];
            data.forEach(function (item) {
                offences.push({
                    value: item.code,
                    text: item.chargeText
                });

to item.idCode

Adam Heim
@truckingsim
what?
value: item.code, becomes value: item.Id,
Al Grant
@bigalnz
instead of returning item.code (1110) I return item.IdCode - yeah its the weird naming convention
idCode is the DB id
Adam Heim
@truckingsim
I was just using what you put above, yes just use whatever db column you need for the value
Al Grant
@bigalnz
ta
I cant see in the browser dev tools where you can inspect the value the dropdown is passing?
Adam Heim
@truckingsim
that's because of how bootstrap-select works, it completely replaces the select, you need go up a level or two to get to it.
it hides it with a display:none
Al Grant
@bigalnz
I am just printing the array to console :-)
Adam Heim
@truckingsim
sure that works too
Al Grant
@bigalnz

The id is coming back

"[{"code":"1110","chargeText":"1110 - Murder","id":3},

So now each row in the array has Code, chargeText, id
so it should be item.id
that seems to be working -nice
I really love your dropdown select
:+1:
Adam Heim
@truckingsim
Thanks
Adam Heim
@truckingsim
v1.4.0 has been released. cdnjs should pick up on it sooner than later.
Al Grant
@bigalnz
You about Adam?
Al Grant
@bigalnz
You there Adam?
Al Grant
@bigalnz
Have you ever used your dropdown with thymeleaf?
Al Grant
@bigalnz
when the form loads I need it to display a already selected value if one is returned from the database. Having a issue with that
Adam Heim
@truckingsim
@bigalnz no I've never used it with that, I've only ever actually used the plugin with one site, the one I created it for, and it died like 6 months after creating the plugin.
I've just kept updating the plugin b/c other people find it useful, but I'll probably never use it again personally.
Al Grant
@bigalnz
It's OK I got it to go
👍👍
Al Grant
@bigalnz
Hey Adam - are you aware of bootstrap select pickers being really slow to render? not your pickers - but the standard plugin
Al Grant
@bigalnz
Hi Adam. Does cloning work with your ajax select?
ribubrar
@ribubrar
Hi Adam, hope you are doing good.
I was facing some problem running live ajax search and I have commented on a thread
truckingsim/Ajax-Bootstrap-Select#83
Could you please take a look at it. Many thanks!
ribubrar
@ribubrar
@truckingsim Could you please help me debug the code in thread with last comment?
truckingsim/Ajax-Bootstrap-Select#31