Guest User

Untitled

a guest
Oct 23rd, 2019
66
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class FrmInvitationToTender {
  2. val gridCatalog = new GridCatalogs()
  3.  
  4. val onChoiceItem = SinkObserver.create[ ( String, String ) ]{ case ( id, description ) =>
  5. grid.hdlRowActive.foreach { idx =>
  6. store.store.onNext (
  7. store.UpdateIdx(idx, Tenderer (id_comparative = "100-2019-ADQ2",key_provider = id, business_name = Some(description)))
  8. )
  9. }
  10. hdlCatalog.onNext(Seq.empty)
  11. Continue
  12. }
  13.  
  14. val gridCatalogSearchResult = grid.hdlPositionCursor.combineLatest ( hdlCatalog ).map { case ( pos, catalog ) =>
  15. val cata = catalog.map ( i => i._1 -> i._2 ).toMap
  16. if (!catalog.isEmpty)
  17. Some(gridCatalog.render(cata, pos, cata.isEmpty, onChoiceItem))
  18. else
  19. None
  20. }
  21.  
  22. def mainGrid ( items: Map [ Int, Map [ String,String ] ] ) =
  23. div ( clear.both, marginTop := "40px",
  24. grid.render ( items ),
  25. gridCatalogSearchResult
  26. )
  27.  
  28. def render = store.store.switchMap { case (a, s) => // concatMap or switchMap { s => // for { s <- store.store } yield {
  29. val dataGrid = s.tenderers.items.zipWithIndex.map{case(prov,i)=>i->Seq("rfc"->prov.key_provider,"proveedor"->prov.business_name.getOrElse("")).toMap }.toMap
  30. Observable ( mainGrid(dataGrid) )
  31. }
  32. }
RAW Paste Data